How enable auto-format code for Intellij IDEA?

0x131313 picture 0x131313 · Jul 26, 2013 · Viewed 189.3k times · Source

Is it possible in Intellij IDEA after typing ';' or press 'Enter' happened formatting of this string?

For instance, to:

a+b=10;

after:

a + b = 10;

Or only possible option: Code > Reformat Code...?

Thank you!

Answer

axelrod picture axelrod · Jul 26, 2013

The formatting shortcuts in Intellij IDEA are :

  • For Windows : Ctrl + Alt + L
  • For Ubuntu : Ctrl + Alt + Windows + L
  • For Mac : ⌥ (Option) + ⌘ (Command) + L