Environment is IntelliJ IDEA 12.
I\'ve got Wrapping and Braces > Assignment Statement > Align when multiline
ticked. When I have adjacent properti
I think you should be using the Field groups => Align in columns
Align when multiline has some other effect that doesn't apply here.
Under "Code Style"->"Java" in the Tab "Wrapping and Braces" find following entry and tick "Align Variable in columns". Done!
To align adjacent variable assignments on the “=” sign, do this:
You can also do this using built-in key bindings without any changes to Intellij options:
How this is done:
Use the following (or equivalent) GNOME
key bindings:
=
(or any delimiter of your choosing)Add Selection for Next Occurrence
Column Selection mode
Column Selection mode
(notice selection is aligned).=
from selectionAfter backspacing to where you want the columns aligned, you should now have something like:
someVar = someVal
someOtherVar = someVal
someOtherOtherVar = someVal
The nice thing about this approach is it's general purpose; The above steps will align any text within whitespace so long as you choose a distinct delimiter each line contains only once, such as =
in the example given.
As noted previously, this example was performed using GNOME
key bindings. You are free to pick a different scheme in Settings
> Keymap
: