PyCharm: Turning selection to multiple cursors per line
From source:
To add carets, do one of the following
Press Shift+Alt and click the
LEFT
mouse button at the location of the caret.Double-click Ctrl and press up arrow or down arrow keys.
On OSX it seems to be enough to press down the LEFT
-ALT and add new carets with mouse LEFT CLICK
, or press down SHIFT+ALT and paint the cursors with mouse.
Hold Alt
and drag the mouse over the desired text.
Source: https://www.jetbrains.com/help/pycharm/2016.1/selecting-text-in-the-editor.html
Another option: with text selected, toggle column selection mode:
The default shortcut to toggle the mode is:
- Linux/Windows:
alt
-shift
-insert
- Mac
cmd
-shift
-(numpad) *
(or Edit
→Column 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.