67

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

88

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
  • 2
    Sorry, but that only enables column selection for mice. I'm trying to select with the keyboard. Commented Dec 11, 2013 at 21:27
  • 8
    @DharmaTurtle Not true. Afterwards you can select text with keyboard as usually (by holding Shift pressed). Commented 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! Commented 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. Commented Feb 20, 2017 at 15:00
  • The mode switching only needs to be done once, it shouldn't be too awkward then. Commented Jun 17, 2019 at 22:47
24

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
    Commented Feb 20, 2023 at 12:44
20

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

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

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

5

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 you have read our privacy policy.

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