Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code select multiple lines by dragging -> multiple cursor

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.

like image 840
Min Lee Avatar asked Jan 08 '19 19:01

Min Lee


People also ask

How do you drag a cursor on multiple lines?

Shift - Alt - I puts a cursor at the end of each selected line. 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. Save this answer.

How do I get multiple cursors at once?

Unfortunately, Windows does not enable users to use multiple cursors at once. However, you may look into other software that might be able to serve your intended purpose. This software is called Pluralinput. Do note that it is a paid program so you might want to take some time to consider first.


1 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.

like image 177
Mark Avatar answered Oct 23 '22 21:10

Mark