Search code examples
visual-studio-code

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.


Solution

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