To select ranges as multiple rectangular selections, Ctrl+Alt+Shift+Click and drag the mouse over the desired parts of code. As a result, you will have multiple selection ranges in each affected document line. On lines that are shorter than the rectangle, the selection will only span to the last character.
Select the lines you want and then press: Windows: Shift + Alt + i. Mac: shift + option + i.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. Switch to the Formatter tab and in the Do not format field, enter the files and directories that you want to exclude using a glob pattern. , the field will expand, and each pattern will be shown on a separate line.
Since Idea IntelliJ IDEA 13.1 there is a possibility to edit multiple lines.
Alt + Shift + Mouse click
Option + Shift + Mouse click
for selection. More about this new improvement in the IntelliJ blog post here. Very useful feature.
I use Column Selection Mode (Cmd+Shift+8 on Mac) which allows to create multiple cursors via Shift+Up or Shift+Down then edit all the lines together.
Starting from IntelliJ IDEA 14 there is also Clone Caret Above / Below:
(hold the second press of the modifier key, then press the arrow key)
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.
Windows: CTRL + CTRL(Hold) + ↑ / ↓
Mac: option + option(Hold) + ↑ / ↓.
To place caret at the end of rows: move caret to top row, clone down to bottom, and click END.
To add a custom Keymap, CTRL+SHIFT+A, type keymap
and click on the one with Settings
as subtext. Search for Clone Caret Above
and Clone Caret Below
.
I mapped mine to ALT+SHIFT+↑ / ↓ on Windows and ⌘+↑ / ↓ on Mac.
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With