Adding items to snippets drawers

To add new items to an existing snippets drawer:
  1. Do one of the following choices:
    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.
    A Customize Palette window appears.
  2. 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.
  3. 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}" %>
  4. 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