Search code examples
visual-studio-codemultiple-cursor

How do I get a cursor on every line in VS Code?


I'm trying to use the multi-cursor functionality of Visual Studio Code on a large(ish) file.
The file is too large to select every line individually with ctrl alt up or ctrl alt down.
In Sublime Text, I would select everything and press ctrl shift L.
Is there a similar thing in VS Code? I've tried using a regex search for ^ (caret), but that gives me an error stating "Expression matches everything".


Solution

  • The command Selection / Add Cursors to Line Ends Alt+Shift+i will put a cursor on every line in the current selection. (For mac use Opt+Shift+i)

    Tip: You can pull up the keyboard shortcut reference sheet with Ctrl+K,Ctrl+S (as in, those two keyboard combos in sequence). (For mac use Cmd+K,Cmd+S)