IntelliJ IDEA 2021.2 Help

Copy 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 IntelliJ IDEA 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 (IDE) code style for each project.

Create a copy of code style settings

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | Code Style, select the desired scheme from the list, and click the Show Scheme Actions button.

  2. Select one of the following options:

    • Copy to IDE: select this option to store the selected scheme in the global level.

      IntelliJ IDEA saves the new code style with the specified name to the config/codestyles/<code_style_name>.xml file under the IntelliJ IDEA home directory.

    • Copy to Project: select this option to store the selected scheme in the project level.

      The selected code style is saved to: .idea/codeStyles/codeStyleConfig.xml.

    • Duplicate: select this option to make a copy of the selected scheme and store it in the same level.

  3. In the Scheme field, type the name of the new scheme and press Enter to save the changes.

  4. Apply changes and close the dialog.

IntelliJ IDEA lets you modify existing names of code style schemes, export or import code style settings.

Manage a code style scheme

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | Code Style, select the desired scheme from the list, and click the Show Scheme Actions button.

  2. From the list, select one of the following options:

    • Rename: change the name of the selected scheme.

    • Export: export your code style settings to the desired location.

    • Import: import IntelliJ IDEA XML code style settings, JSCS config file, or Eclipse XML Profile.

  3. In the Scheme field, type the name of the new scheme and press Enter to save the changes.

  4. Apply changes and close the dialog.

Last modified: 11 October 2021