To modify an existing template
- In the IDE settings, open the Live Templates page, and expand the desired template group.
- Select template you want to change, and click Edit.
- In the Edit Live Template dialog box, change template abbreviation as required.
- In the Template Text field, edit the template body which may contain plain text and variables. To change variables in a template, click the Edit Variables button.
- In the Options section, specify how the template will be expanded and reformatted.
- In the Context section, specify the languages and places of code where the editor should be sensitive to the template abbreviation.
- Click OK when ready.
To create a new template from scratch
- In the IDE settings, open the Live Templates page, and expand the template group where you want to create a new template.
- Click the Add button.
- In the Add Live Template dialog box, specify the new template abbreviation.
- Type the template body, define variables, template group and options, as described in the template modification procedure.
- Click OK when ready.
To create a live template from a text fragment
- In the editor, select the text fragment to create a live template from.
- On the main menu, choose . The Edit Live Template dialog box appears.
- In the Abbreviation field, type abbreviation to identify your new live template.
- Type the template body, define variables, template group and options, as described in the template modification procedure.
- Click OK when ready.
Abbreviation may contain alphanumeric characters, dots, and hyphens, and must be unique within a template group. However, you can use same abbreviation for different templates provided they are in different groups.
