Is there any way to change indentation style for automatically generated code in Eclipse? I'd like to change from
class Test {
blah blah
}
to
class Test
{
blah blah
}
You can use Ctrl + A to select the entire file, then use this shortcut to quickly fix all the indentation. You can also change how Eclipse handles indentation by going to Window > Preferences, then in the left panel, navigate to Java > Code Style > Formatter > Edit... > Indentation.
If you are using multi-line comments (/* */), the fix to prevent Eclipse from applying its auto-formatting is very simple: just add a dash (-) after the asterisk at the beginning of the comment (see below).
If you do change the format of the brace, all new class will be generated according to that new format:
It's in "Window | Preferences" in the latest eclipse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With