Thursday, October 15, 2009

Eclipse Auto Formatting

If you like your code formatted, indented neatly, imports arranged, etc. every time you edit your programs, this is one shortcut I find very effective:

Goto: Window -> Preferences
Select Java -> Editor -> Save Actions

On the right are actions that you can ask Eclipse to perform every time you hit Ctrl + S. Besides the basic options click on "Configure" to add formatting actions and other misc stuff.

This way you don't have to worry about Ctrl-Shift F, Ctrl-Shift-O or any other shortcut, except Ctrl-S to save, which you probably know since 6th grade.

No comments:

Post a Comment