IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Reformat and rearrange code

Last modified: 15 June 2021

IntelliJ IDEA lets you reformat your code according to the requirements you've specified in the Code Style settings. However, if you use EditorConfig in your project, options specified in the .editorconfig file override the ones specified in the code style settings when you reformat the code.

To access the settings, in the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | Code Style. See Configuring code style for details.

You can reformat a part of code, the whole file, group of files, a directory, and a module. You can also exclude part of code or some files from the reformatting.