136
votes

I heard Microsoft released a new editor called Visual Studio Code and it looks pretty good. One key feature that I need is multi-line edit and I can't seem to find anything about it having it.

5
Related post here. - RBT
From April 2018 (version 1.23), we can use middle mouse button to select multiple columns. code.visualstudio.com/updates/… - blueray

5 Answers

337
votes

Box Selecting

Windows & Linux: Shift + Alt + 'Mouse Left Button'

macOS: Shift + option + 'Click'

Esc to exit selection.

MacOS: Shift + Alt/Option + Command + 'arrow key'

33
votes

Press Ctrl+Alt+Down or Ctrl+Alt+Up to insert cursors below or above.

20
votes

The shortcuts I use in Visual Studio for multiline (aka box) select are Shift + Alt + up/down/left/right

To create this in Visual Studio Code you can add these keybindings to the keybindings.json file (menu FilePreferencesKeyboard shortcuts).

{ "key": "shift+alt+down", "command": "editor.action.insertCursorBelow",
                                 "when": "editorTextFocus" },
{ "key": "shift+alt+up", "command": "editor.action.insertCursorAbove",
                                 "when": "editorTextFocus" },
{ "key": "shift+alt+right", "command": "cursorRightSelect",
                                     "when": "editorTextFocus" },
{ "key": "shift+alt+left", "command": "cursorLeftSelect",
                                     "when": "editorTextFocus" }
12
votes

For multiple select in Visual Studio Code, hold down the Alt key and starting clicking wherever you want to edit.

Visual Studio Code supports multiple line edit.

0
votes

On Windows it's holding down Alt while box selecting. Once you have your selection then attempt your edit.