Search code examples
intellij-ideakeyboard-shortcutsintellij-14reformatting

How to reformat all the open files in IntelliJ


Is there any shortcut to reformat the code in all the open files in IntelliJ? I'm specifically looking for a way to reformat all the open files inside editor and not all the files in project.


Solution

  • The closest that I could recommend is to select the root folder from the project explorer and press alt+command+L(MAC OS). Reformat Code window pops up. In the pop-up, select the scope as Open files and Click run. It formats all the open files enter image description here

    Intellij Documentation -->https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#reformat_module_directory