Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to have all local variables aligned in Eclipse?

Eclipse has a great feature to allow you to align all your 'fields in columns' meaning that it will turn:

int myVar = 2334;
int asdf = 34;
String s = "hello";

into

int     myVar  = 2334;
int     asdf   = 34;
String  s      = "Hello";

This makes the code a lot more readable and I love it. However I can't seem to find a similar setting to make it do that for regular local variables. Anyone know if there is a way? It'd be a shame if there isn't one.

Thanks

like image 260
Matthew Stopa Avatar asked Dec 26 '09 08:12

Matthew Stopa


1 Answers

If you go in Eclipse's settings, Java -> Code Style -> Formatter, you may edit or create a new profile.

Anyway, in the Indentation tab, there is an "Align fields in columns" option that should do what you are looking for.

like image 62
Y__ Avatar answered Oct 14 '22 11:10

Y__