What is the auto-alignment shortcut key in Eclipse?
Asked
Active
Viewed 2.8e+01k times
5 Answers
318
Ctrl+Shift+F to invoke the Auto Formatter
Ctrl+I to indent the selected part (or all) of you code.

Hulk1991
- 3,079
- 13
- 31
- 46

Peter Perháč
- 20,434
- 21
- 120
- 152
-
8I was hoping for something that would align = signs across several lines of assignment statements. :( – David J. Aug 11 '11 at 03:19
-
1hi Peter thank you for sharing information this is useful for edit format document file .. – Narasimha Oct 28 '13 at 10:39
-
I wonder why they put "CTRL + ALT + L (Win)" as the answer out there.... http://developer.android.com/sdk/installing/studio-tips.html#KeyCommands – gumuruh May 29 '14 at 05:13
-
@DavidJames: for aligning on a special character or string, see [djeikyb's answer](http://stackoverflow.com/a/20432333/1498405) for the plugin [Columns4Eclipse](http://columns4eclipse.sourceforge.net/) – hardmooth Aug 25 '15 at 12:29
-
`Cmd`+`I` on Mac respectively – Aleksey Potapov May 26 '16 at 15:35
-
In my case in MAC, it is: cmd + Shift + F – cyberPrivacy Sep 23 '16 at 12:11
-
1On Mac : ⌘ + ⇧ + F – Jaydev Jun 05 '17 at 14:12
18
The answer that the OP accepted is wildly different from the question I thought was asked. I thought the OP wanted a way to auto-align =
signs or +
signs, similar to the tabularize plugin for vim.
For this task, I found the Columns4Eclipse plugin to be just what I needed.

djeikyb
- 4,470
- 3
- 35
- 42
13
Want to format it automatically when you save the file???
then Goto Window > Preferences > Java > Editor > Save Actions
and configure your save actions.
Along with saving, you can format, Organize imports,add modifier ‘final’ where possible etc

jai
- 21,519
- 31
- 89
- 120
-
Can I work with one formatter profile and save with another formatter. – Richard Lalancette Mar 22 '12 at 19:13
0
auto-alignment shortcut key Ctrl
+Shift
+F
to change the shortcut keys Goto Window > Preferences > Java > Editor > Save Actions

Akitha_MJ
- 3,882
- 25
- 20