9

In Intellij IDEA is there a way to enable column selection mode by holding down Alt, like in other IDEs (for example Visual Studio or Notepad++)?

Currently when pressing Alt IntelliJ uses the multicursor feature, which always results in me having an aditional cursor somewhere where I don't want it.

example image multicursor

The middle mouse button (hold and drag) does exactly what I want, I just wished I could remap it to the Alt key

Mikescher
  • 875
  • 2
  • 16
  • 35
  • Works fine for me - IJ 2016.3.4, 2017.1.2 EAP; Win 10 – Meo Apr 26 '17 at 17:25
  • 1
    Not an exact answer, but [`Alt+Shift+Insert`](http://stackoverflow.com/a/26386163/2646526) toggles `Column Selection Mode`. You could map that to something more wieldy, like `Alt+Z`. – heenenee Apr 26 '17 at 17:26
  • https://youtrack.jetbrains.com/issue/IDEA-136779 – Meo Apr 26 '17 at 17:27
  • I've just checked the case (with holding ALT and selecting column) in Intellij IDEA 2017.1.2 and 2016.3.5 on my Linux Mint and it works too. Can it depend on OS, where the IDEA is run? – Oleksandr Tarasenko Apr 27 '17 at 09:26
  • @OleksandrTarasenko: Try typing something after you have selected a rectangle. It should always also type somewhere else, because it doesn't remove the cursor that was there when you started the selection. – Mikescher Apr 27 '17 at 10:55
  • @Meo: Thanks, now I can at least subscribe to this issue :D – Mikescher Apr 27 '17 at 10:55
  • @Mikescher it still works fine on my environment even with the conditions you are talking about. – Oleksandr Tarasenko Apr 27 '17 at 13:11
  • @OleksandrTarasenko: Hmm I'm currently on my Windows machine. I will try my Linux Laptop this evening, it sounds strange that this should be OS-dependent. – Mikescher Apr 27 '17 at 15:23
  • @OleksandrTarasenko: Ok.. thats embarrassing :D. I've updated IntelliJ on my windows machine and now alt+drag works as expected. Thy must have changed it in one of the last updates. Feel free to post an answer and claim the reward – Mikescher Apr 27 '17 at 17:12

3 Answers3

4

In Preferences > Keymap > Editor Actions set

Create Rectangular Selection on Mouse Drag to ⌥ Click (clears old cursors)

Note that it should be Create instead of Add, and if you like you could set

Add Rectangular Selection on Mouse Drag to ⌥ ⇧ Click (keeps old cursors)

elgehelge
  • 2,014
  • 1
  • 19
  • 24
1

From the comment, I assume that it's a version issue. Updating the IDE may be solve your issue.

orvi
  • 3,142
  • 1
  • 23
  • 36
  • yep, as @OleksandrTarasenko in the comments said: It seems they have fixed it in one of the last updates. Now the selection behaves the same as with other editors. – Mikescher May 03 '17 at 10:52
0

On Mac, you can choose column selection mode or the temporal shortcut:

  • Fn+option+mouse selection
  • Cmd shift 8 to mode selection
Alberto Soto
  • 111
  • 3