What is the Auto-Alignment Shortcut Key in Eclipse?
Asked Answered
M

5

172

What is the auto-alignment shortcut key in Eclipse?

Michi answered 4/3, 2010 at 10:1 Comment(0)
A
318

Ctrl+Shift+F to invoke the Auto Formatter

Ctrl+I to indent the selected part (or all) of you code.

Adopted answered 4/3, 2010 at 10:4 Comment(7)
I was hoping for something that would align = signs across several lines of assignment statements. :(Candis
hi Peter thank you for sharing information this is useful for edit format document file ..Meniscus
I wonder why they put "CTRL + ALT + L (Win)" as the answer out there.... developer.android.com/sdk/installing/…Keefer
@DavidJames: for aligning on a special character or string, see djeikyb's answer for the plugin Columns4EclipseRespectively
Cmd+I on Mac respectivelyGromme
In my case in MAC, it is: cmd + Shift + FViridi
On Mac : ⌘ + ⇧ + FQualitative
L
36

Auto-alignment? Lawful good?

If you mean formatting, then Ctrl+Shift+F.

Lappet answered 4/3, 2010 at 10:2 Comment(0)
F
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.

Fearfully answered 6/12, 2013 at 19:47 Comment(1)
An under-rated answer!Deity
C
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

Crestfallen answered 4/3, 2010 at 11:51 Comment(1)
Can I work with one formatter profile and save with another formatter.Urdar
M
0

auto-alignment shortcut key Ctrl+Shift+F

to change the shortcut keys Goto Window > Preferences > Java > Editor > Save Actions

Marna answered 20/4, 2020 at 12:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.