File and Code Templates
for Windows and Linux
for macOS
Ctrl+Alt+S
Files can be created according to pre-defined templates (file templates). Use this page to view, edit, and create such templates.
Different groups of templates are located on different tabs.
When you select a template, its contents and description are displayed in the right-hand part of the page.
Per-project vs default scheme
Item | Description |
---|---|
Scheme | From this drop-down list, choose whether file and code template settings pertain to the entire workspace, or the current project: |
Refer to the section Project and IDE Settings for details.
Tabs
Toolbar
Template settings and contents
Item | Description |
---|---|
Name | This text box appears when a new template is created. Specify the name of the new template. |
Extension | In this text box, specify the extension. WebStorm will apply this template when new files of this type are created. |
Template text | Edit the template contents. You can use:
|
Reformat according to style | Select this check box, to have WebStorm reformat generated stub files according to the style defined on the Code Style page. |
Enable Live Templates | Select this check box to use a live template inside a file template. So doing, one has to put the live template fragments into Velocity escape syntax. For example: #[[ $MY_VARIABLE$ $END$ ]]# Thus, one can specify the cursor position. Note that it is required to use the live template variables here! |
Description | This read-only field provides information about the template, its predefined variables, and the way they work. This field is not available in custom templates. |
See Also
Last modified: 17 July 2017