Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm: Turning selection to multiple cursors per line

Tags:

pycharm

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

enter image description here

Is there PyCharm equivalent?

like image 936
Mikko Ohtamaa Avatar asked Apr 18 '15 15:04

Mikko Ohtamaa


People also ask

How do I get multiple cursors in PyCharm?

To select ranges as multiple rectangular selections, Ctrl+Alt+Shift+Click and drag the mouse over the desired parts of code. As a result, you will have multiple selection ranges in each affected document line.

How do you multiply cursors?

What are the keyboard shortcuts for creating multiple cursors in VS Code? Just hold down the Alt button and start clicking in different places. That's it. CMD+Alt+Down arrow is what you want.


1 Answers

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.

like image 186
jeremyh Avatar answered Sep 28 '22 15:09

jeremyh