3

In sublime, you can select all text, and then hit Expand selection to line and a cursor will be placed on each line within the selection.

Is there an equivalent for VS Code?

2 Answers 2

6

The function is called: Create multiple cursor from selected lines

  • Select lines
  • Press F1
  • Type multi

Or press Shift+Alt+I

Note: Cursors will be at end of lines. Press Home to send them at beginning of lines.

Sign up to request clarification or add additional context in comments.

4 Comments

Is there a way to specify if the cursor should be placed at beginning or end of the lines selected?
Afaik, there isn't. You can press Home
So what you are saying, there is a way on PCs. Shift-Alt-I then Home, and whatever is equivalent on your Mac. I'd add that Home comment to the answer, I think it adds value.
Exactly what I'm looking for thank! And the Home was helpful too.
0

you are referencing two different things in your question

split_selection_into_lines and the more "usual" expand_selection

Name in ST* ST keybinding vscode keybinding Name in vscode*
"usual" expand_selection to line Ctrl + L Ctrl + L Expand Line Selection
"advanced" split_selection_into_lines Ctrl + Shift + L Shift + Alt + i Add Cursors to Line Ends

Name in ST: name in Sublime Text keymap (click preferences > keybindings)

Name in vscode: name in VS Code Keyboard Shortcuts menu (search shortcuts from the command palette)

"usual" because it available from the Sublime Text Selection menu.

"advanced" because apart from Bart Simpson we aren't much using this :)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.