Intellij code formatting, Java annotations on new lines

catrapture picture catrapture · Mar 8, 2013 · Viewed 31.7k times · Source

I'm using IntelliJ 12 and It's putting my member variable annotations on the same line, which i hate! How do I setup the code formatter to keep annotations on separate lines?

thanks!

Answer

Daniel Williams picture Daniel Williams · Mar 8, 2013

Navigate to Preferences → Editor → Code Style → Java → Wrapping and Braces tab, then locate the section Field annotations and check the option Do not wrap after single annotation.

In IntelliJ v14:

eIntelliJ v14 Java style preferences