Adding items to snippets drawers
Procedure
- Do one of the following choices: A Customize Palette window appears.
To start with this item: Do this action: An empty item that you can edit Right-click anywhere in an existing drawer, select Customize, and click New > New Item. Existing text that is 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 that is pasted into a new item in a new or existing drawer Select the text, right-click and then select Add to Snippets. In the New Category dialog box, specify the name of the drawer to which you want to add the item, and click OK. - Type a name for the new item, and provide a description. The value that you type in the Name field appears next to the item icon in the Snippets view.
- To include in the Template Pattern field, a variable that you already defined, click Insert
Variable Placeholder. A variable placeholder
is a marker that, when tagging is inserted into the active file, is
replaced by the value that is entered into the Insert Template:Item_name dialog at insertion time. Clicking Insert Variable Placeholder or typing Ctrl+Space activates
a pop-up in the text area that prompts you to create a marker for
the variable. For example, if you create two variables
that are named uri and prefix, and create variable placeholders for both, the template pattern
might look like the following example:
<%@ taglib uri="${uri}" prefix="${prefix}" %>
- Click OK.
Results
Parent topic: Editing with snippets

