IntelliJ Column Selection using Cursor Keys

2019-02-01 15:56发布

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?

8条回答
贪生不怕死
2楼-- · 2019-02-01 16:05

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.

查看更多
再贱就再见
3楼-- · 2019-02-01 16:09

It is also possible to select holding middle mouse key.

查看更多
老娘就宠你
4楼-- · 2019-02-01 16:10

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

查看更多
甜甜的少女心
5楼-- · 2019-02-01 16:16

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

查看更多
Anthone
6楼-- · 2019-02-01 16:19

In Windows or Linux I press two times Ctrl

查看更多
老娘就宠你
7楼-- · 2019-02-01 16:21

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.

查看更多
登录 后发表回答