VS Code select multiple lines by dragging -> multiple cursor

Viewed 7892

I have been using Sublime for many years and now I want to try VS Code. In Sublime, I could have had multiple cursors at the end of each line by dragging multiple lines of code and pressing Ctrl+Shift+L. But it seems in VS Code it just sends the cursor to the end of selected lines.

I know I could use Alt+click or Ctrl+Alt+arrow to do similar act but I really love that I could just drag and have multiple cursors.

Is it possible to do the same thing in VS Code?

Thank you.

2 Answers

Shift-Alt-I puts a cursor at the end of each selected line.

Command is : editor.action.insertCursorAtEndOfEachLineSelected

Ctrl-Shift-L is already bound to another command: command:editor.action.selectHighlights

But you could rebind either one if you wanted to or just learn Shift-Alt-I.


Also, you can try Shift-Alt-drag if you still want those lines selected (hit right/end to unselect but leave cursors at end of each line.

In my case on Ubuntu, I have to hold the Ctrl or Alt based on editor.multiCursorModifier in the setting, and then click on the places where I wanted to have cursor there. Also, I could select multiple lines by holding Shift+Ctrl or just Alt and dragging mouse. This is available only when I set editor.multiCursorModifier to ctrlCmd in the settings or by adding the following line to settings.json.

    "editor.multiCursorModifier": "ctrlCmd"
Related