Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Continuation Indent

Is there a way to configure the indentation eclipse uses for manual line breaks? It indents by 8 spaces no matter what I do.

I get this:

private static final org.apache.log4j.Logger LOG =
        org.apache.log4j.Logger.getLogger(myClassname.class);

when I'd like it to give me this:

private static final org.apache.log4j.Logger LOG =
    org.apache.log4j.Logger.getLogger(myClassname.class);

Eclipse's line wrapping can be configured to give me the correct result when the line is too long, but I'd like to be able to get less indentation even if the line break is manual.

like image 504
AAudibert Avatar asked Jun 05 '13 21:06

AAudibert


1 Answers

In Eclipse Juno

  • open the preferences dialog (Window > Preferences).
  • go to the preference page Java > Code Style > Formatter.
  • press the Edit... button (for the Active profile).
  • if it is the default one from Eclipse (Eclipse [built-in]), you need to give it a new name.
  • click on the Line Wrapping tab
  • set the value to 1 for "Default indentation for wrapped lines" (by default it is 2)

(check the Identation tab and check what the indentation size is set at, by default it should be 4)

like image 127
Simon Arsenault Avatar answered Oct 23 '22 10:10

Simon Arsenault