62

Is it possible to select text vertically/in a column in PyCharm? You can do it in Visual Studio and Notepad++ by holding down alt+arrow keys.

The documentation describes how to do it with the mouse, but there's no mention of keyboard options.

http://www.jetbrains.com/pycharm/webhelp/selecting-text-in-the-editor.html#d306531e464

6 Answers 6

82

Press Ctrl+Shift+A (Find Action feature) and type column. The first result is Column Selection Mode Alt+Shift+Insert. After that, select text with keyboard (by holding Shift)

6
  • 1
    Sorry, but that only enables column selection for mice. I'm trying to select with the keyboard. Dec 11, 2013 at 21:27
  • 8
    @DharmaTurtle Not true. Afterwards you can select text with keyboard as usually (by holding Shift pressed). Dec 12, 2013 at 8:59
  • 2
    Ohhh, I was trying to hold down Shift+Alt as I did with all the other programs. This mode switching is a bit awkward, but I guess I can live with it. Thanks very much! Dec 12, 2013 at 16:55
  • 2
    Thanks for mentioning find action. It is command+shift+A in Macs and I found the mac command for column select mode: command+shift+8. Feb 20, 2017 at 15:00
  • The mode switching only needs to be done once, it shouldn't be too awkward then. Jun 17, 2019 at 22:47
19

First press ctrl (press and release), then press ctrl+arrows to do the vertical selection.

4
  • @Gulzar I was using it on Windows.
    – Étienne
    May 28, 2020 at 17:25
  • 1
    Works on Linux. Very nice feature. Jun 9, 2021 at 7:27
  • 3
    On MacOS, replace ctrl for option May 12, 2022 at 17:24
  • 1
    ctrl + ctrl (keep ctrl) + up/down arrow on linux
    – F.Tamy
    Dec 21, 2022 at 10:26
19

In Mac, Hold option + Shift - and use mouse to select the text vertically

1
  • Why is this answer upvoted? The question is how to do it without the mouse.
    – Étienne
    Feb 20 at 12:44
13

In the free version of Pycharm this is called Column Selection Mode and it's enabled pressing Shift + Command + 8

Column Selection Mode

Edit: Noticed Ozgur Ozturk beat me to this in his comment and as he points out this combo is for Macs only

4

Go to Settings > Keymap > Editor Actions > Add Rectangular Selection on Mouse Drag and add Alt + Button1 Click as a new action.

This will allow you to create rectangular selections across multiple rows and columns like you know it from Notepad++.

3

If someone still searching (as I did): ALt + Shift + mouse works for me on windows

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.