Adding items to snippets drawers
This documentation describes how to add a new item to a drawer in the Snippets view.
To add new items to an existing snippets drawer:
- Do one of the following choices:
A Customize Palette window appears.
To start with this: Do this: An empty item that you can edit Right-click anywhere in an existing drawer, select Customize, and click New > New Item. Existing text pasted into a new item in an existing drawer Copy or cut text to the clipboard. In the Snippets view, right-click anywhere in an existing drawer and click Paste. Existing text pasted into a new item in a new or existing drawer Select the text, right-click, click Add to Snippets, specify the name of the drawer in the Snippets view to which you want to add the item, and click OK. - Type a name for the new item, and, optionally, provide a description. The value that you type in the Name field will appear next to the item's icon in the Snippets view.
- To include in the Template Pattern field a variable that you have already defined, click Insert Variable Placeholder. A variable placeholder is a marker that, when tagging is inserted into the active file, will be replaced by the value that is entered into the Insert Template:Item_name dialog at insertion time. Clicking the Insert Variable Placeholder button or typing Ctrl+Space activates a pop-up in the text area that prompts you with the correct sequences to create a marker for the variable. For example, if you create two variables named uri and prefix, and create variable placeholders for both, the template pattern might look like this:
<%@ taglib uri="${uri}" prefix="${prefix}" %>- Click OK.
The new item will be added to the list of items in the appropriate drawer.
Related concepts
Snippets view
Related tasks
Editing with snippets - overview
Adding snippets drawers
Editing snippet items
Deleting or hiding snippet items or drawers