PyCharm: Turning selection to multiple cursors per line

后端 未结 8 1325
梦谈多话
梦谈多话 2020-12-13 01:53

Sublime Text has this functionality where you can select text and start editing each line with a (multiple) cursor:

相关标签:
8条回答
  • 2020-12-13 02:26

    To do this on Linux (tested on Ubuntu 16.04), do as follows:

    In your editor, press Alt + Windows Key and use your mouse to place the cursor on the lines you want to have multiple cursors on.

    You may also want to allow placement of caret after the end of line or inside tabs. In that case you need to change your settings:

    Go to Editor -> Generaral -> Virtual Space:

    • [x] Allow placement of caret after end of line
    • [x] Allow placement of caret inside tabs

    And make sure the above mentioned two settings are enabled.

    0 讨论(0)
  • 2020-12-13 02:27

    Another option: with text selected, toggle column selection mode:

    enter image description here

    The default shortcut to toggle the mode is:

    • Linux/Windows: alt-shift-insert
    • Mac cmd-shift-(numpad) *

    (or EditColumn Selection Mode)

    It's an inconvenient shortcut for Mac, as most laptops have no numpad. I remapped it to cmd-shift-8.

    Column selection mode actually has other purposes too: it changes the default behavour when selecting text with the keyboard and mouse. Toggle it off again to return to normal selection behaviour.

    0 讨论(0)
提交回复
热议问题