Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I *exit* multi-cursor mode in VSCode from the keyboard?

Tags:

It's nice that Visual Studio Code has a multi-cursor mode, and it's nice that it is possible to access it solely from the keyboard (although it would be much better if it worked according to native UI patterns on the Mac, but that's a different matter).

What's really frustrating, though, is that it seems to require using the mouse to get out of it.

Is there any keystroke that natively exits from multi-cursor mode?

Is there any command that does this that can have a keystroke bound to it?

Is there any extension that allows you to exit multi-cursor mode solely using the keyboard?

like image 206
iconoclast Avatar asked Jun 14 '18 19:06

iconoclast


2 Answers

This is the default setting, enabling Shiftescape to exit multi-cursor mode:

{ "key": "shift+escape",          "command": "removeSecondaryCursors",
                                     "when": "editorHasMultipleSelections && textInputFocus" },

So I've added the following to my own configuration, to enable the much more intuitive escape to exit multi-cursor mode:

{ 
  "key": "escape",      
  "command": "removeSecondaryCursors",
  "when": "editorHasMultipleSelections && textInputFocus" 
},
like image 109
iconoclast Avatar answered Sep 22 '22 08:09

iconoclast


Simply type Esc when there is no text selected, just multiple cursors.

Esc button reduces the three cursors to one

like image 21
Jundiaius Avatar answered Sep 25 '22 08:09

Jundiaius