IntelliJ Column Selection using Cursor Keys

Android StudioIntellij IdeaMultiple ColumnsTextselectionIntellij 13

Android Studio Problem Overview


Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop.

For instance when I'm typing code I almost always do my navigation solely through use of the keyboard. In the IDEs mentioned previously I can quickly select blocks of code by holding Shift + Alt then tapping to extend my cursor across the lines above. I can then hold Shift + Alt + Ctrl and tap or to quickly jump across words and select the chunk of text I want.

In IntelliJ IDEA I have to constantly enable and disable Column Selection Mode using the Shift + Alt + Insert and even then it doesn't quite function as it does in the other IDEs or Text Editors.

Any ideas?

Android Studio Solutions


Solution 1 - Android Studio

You can do column editing using the Edit | Column Selection Mode.

The shortcut to turn it on/off is Alt+Shift+Insert. You navigate with arrow keys to select blocks of text.

Solution 2 - Android Studio

Multiline Caret (without mouse)

Windows/Linux: CTRL + CTRL(Hold) + ↑ / ↓

Mac: + (Hold) + ↑ / ↓

ESC will end multiline mode.

Change Multi-caret Hotkey

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+↑ / ↓.

Bonus

Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.

Solution 3 - Android Studio

It is also possible to select holding middle mouse key.

Solution 4 - Android Studio

Go to the Settings | Keymap and set a shortcut for Clone Caret Above and for Clone Caret Below

Solution 5 - Android Studio

On a mac, to toggle block select on/off:

shift command 8

8

Solution 6 - Android Studio

For me on Mac:

Press once 'option' key, release it, and press and hold it again. Now navigate with cursor to select desired code. Press 'Esc' to exit column mode! :)

Solution 7 - Android Studio

Most convenient way is to:

  • MAC: Hold Option+Shift and click with mouse.
  • Windows: Hold Alt and click with mouse.

Solution 8 - Android Studio

I think @Meo's answer is the most correct, but if your hand happens to be on the mouse, you can also accomplish this with Ctrl+Alt+Shift+Left Mouse Button Click. Or look for the Add Rectangular Selection on Mouse Drag in the keymap settings.

Solution 9 - Android Studio

In Windows or Linux I press two times Ctrl

Solution 10 - Android Studio

For Mac cmd+shift+* didn't work for me. I changed the keymap to something else and now it works seamlessly.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoshua BarnettView Question on Stackoverflow
Solution 1 - Android StudioduffymoView Answer on Stackoverflow
Solution 2 - Android StudioGiboltView Answer on Stackoverflow
Solution 3 - Android StudiokybView Answer on Stackoverflow
Solution 4 - Android StudioMeoView Answer on Stackoverflow
Solution 5 - Android StudioBohemianView Answer on Stackoverflow
Solution 6 - Android StudioLeXavView Answer on Stackoverflow
Solution 7 - Android StudiolukyerView Answer on Stackoverflow
Solution 8 - Android StudioWesley MusgroveView Answer on Stackoverflow
Solution 9 - Android StudioCarlos VerdesView Answer on Stackoverflow
Solution 10 - Android StudiosiaView Answer on Stackoverflow