IntelliJ IDEA 12.1.0 Web Help

You can reformat source code to meet the requirements of your code style. IntelliJ IDEA will lay out spacing, indents, keywords etc.

Reformatting can apply to the selected text, entire file, or entire project.

To reformat source code
  1. On the main menu, choose Code | Reformat Code, or press Ctrl+Alt+LCtrl+Alt+LAlt+Shift+LCtrl+Alt+LCtrl+Alt+LCtrl+Alt+LAlt+F8 or Ctrl+Alt+FAlt+Shift+FCtrl+Alt+L or Ctrl+Shift+FMeta Alt LMeta Alt LMeta Shift F.
  2. In the Reformat Code dialog box, specify the reformatting scope:
    • The current file.
    • Selected text.
    • All files in the current directory, including or omitting subdirectories. You can also include optimizing imports, by checking the Optimize imports option, which is enabled for the current directory only.
  3. Click Run.

See Also

Reference:

Web Resources: