Copying Code Style Settings
You can define the code styles that differ from the pre-defined ones. These code style schemes are stored in XML files,
in the config/codestyles
folder under the user home directory.
You can use the created copy for modifying code styles, and for export.
If you select a code style scheme other than Project, then this code style will be saved for a project. Thus you can assign a global code style for each project.
In this section:
To create a copy of code style settings
- In the Code Style page, select the desired scheme from the drop-down list, and click Manage.
- In the Code Style Schemes dialog box that opens, click Save As....
- In the Save Code Style Scheme As dialog box, type the name of the new scheme.
WebStorm saves the new code style with the specified name in the
config/codestyles/<code_style_name>.xml
file under the WebStorm home directory. - Close the Code Style Schemes dialog box, and apply changes.
To copy code style settings to a current project
- In the Code Style page, select the desired scheme from the drop-down list, and click Manage.
- In the
Code Style Schemes
dialog box that opens, click Copy to Project:
The selected code style is saved in the
.idea
directory in the filecodeStyleSettings.xml
. - In the Copy Scheme to Project dialog box, confirm switching to the new scheme, if necessary (Yes):
Then close the Code Style Schemes dialog box, and apply changes.