Reformatting a Whole Directory
Alternatively, you can reformat a specific directory. This option is really useful if you're reformatting a larger project in stages. You can perform the reformat at directory with ⌘1 (macOS), or Alt+1 (Windows/Linux) to display the Project Window and then right-click on the directory you want to reformat. From the context menu you can press the Reformat Code option to reformat all the code in that directory:
Alternatively, you can select the directory and use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to display the same dialog.
IntelliJ IDEA also supports EditorConfig files. In the next step of this tutorial we will take a look at why they're useful and how to use them.