I've seen this done in TextMate and I was wondering if there's a way to do it in IDEA.
Say I have the following code:
leaseLabel = "Lease";
leaseLabelPlural = "Leases";
portfolioLabel = "Portfolio";
portfolioLabelPlural = "Portfolios";
buildingLabel = "Building";
What is the best way to append '+ "foo"' to every line? Column mode won't work since the lines are not correctly aligned on the right side... unless there is an easy way to right justify the text :P
For Mac:
You could also do a vertical code block selection by clicking mouse wheel and dragging:
Hold ALT and use the mouse for click and drag
Another keyboard-only approach. It's possible (since 13.1 version) to use Alt+J / Shift+Alt+J (Ctrl+G for OS X) shortcuts for creating multiple carets. Alt+J selects the next occurrence of the currently selected text and adds another caret.
It's
Option + Shift + Click
for Macbook.All Important Intellij Shortcuts: https://docs.google.com/document/d/1KagEr4hDmTugMJJLsYUgc122zXEnbj4A2vHoe8PtKpo/edit?usp=sharing
Column mode works just fine: first select all the lines in column mode, then press END: each cursor will jump to the end of respective line.
On Linux (NO MOUSE NEEDED):
ALT
+ SHIFT + INSERT` to enter block-modeSHIFT + UP
orSHIFT + DOWN
to select multiple linesEND
to jump to the end of each linenow type
foo
, it will append it to each line:Now deselect everything with
ESCAPE
and switch back to normal selection mode withALT + SHIFT + INSERT
.