IntelliJ IDEA 13.1 Web Help

Some features described here are available in Ultimate edition only.

You can create search and replace templates from scratch, just typing the code in the text area of the Structural Search / Replace dialog box. However, there is a collection of the predefined search templates that you can use as prototypes for your own templates. All custom templates appear in the list of existing search templates, under the node User defined.

To create a search template, follow these general steps
  1. On the main menu, choose Edit | Find | Search Structurally, or press Ctrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SCtrl+Shift+SShift Command SShift Command SShift Command S.
  2. Do one of the following:
    • Type the code of your template in the Search template text area.
    • Click the Copy existing template button, and in the Existing Templates dialog box, select the desired template as a prototype. The source code of the selected template appears in the Search template text area, where you can change it as required.
  3. If you need to configure the template variables, click the Edit variables button. Edit Variables dialog box appears.

    In the Variables column, select a variable you want to configure, and specify the constraints that will apply to this variable. See the dialog reference page for the detailed description of constraints.

    Repeat the process for the other variables, as required, apply changes and close the dialog box.

  4. Click the Save Template button.
  5. In the Save Template dialog, type the name of the new template, and click OK.

Tip

You can create a new template in the Existing Templates dialog. To do that, click the add button in the toolbar. This opens the Structural Search dialog, with the empty template field. To define the custom template, follow the steps described above.

See Also

Concepts:

Reference:

Web Resources: