
To make finding and editing templates easier, they are split into groups. On the Live Templates page, you can see all the available live templates, edit them and create new templates.

To configure live templates, open the Editor | Live Templates page of the IDE settings Control+Alt+S. if after an expression to invoke the corresponding postfix completion and wrap the expression with an if statement. JavaScript postfix templates are live templates, but create constructs for existing code. You can also select a block of code, then press Control+Alt+J to open the Select Template popup and select the T template to wrap the selection with a pair of tags. For example, T expands into a pair of tags, for which you can specify a name.
#Customize template .js webstorm form code#
Surround templates wrap a block of the selected code with the text specified by the user. For example, importitems expands into an import statement where you can first specify the path and then the imported members as parameters.

When you expand a parameterized template, variables are either replaced by input fields for the user to specify manually, or calculated by WebStorm automatically. Parameterized templates contain variables that enable user input. For example, flow inserts a annotation, vbase expands into a stub for a Vue single file component, and so on. When you expand a simple template, the text is automatically inserted into your source code, replacing the abbreviation. Simple templates contain only fixed plain text. The following types of live templates are distinguished: Press Shift+Tab to move to the previous variable. Keep pressing Tab to jump from one variable in the template to the next one. To expand a code snippet, type the corresponding template abbreviation and press Tab.

Use live templates to insert common constructs into your code, such as loops, conditions, declarations, or print statements.
