Does Visual Studio Code have box select/multi-line

2019-01-21 07:04发布

问题:

This question already has an answer here:

  • Multiline editing in VSCode 17 answers

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.

回答1:

Box Selecting

Windows & Linux : shift + alt + 'Mouse Left Button'

macOS : shift + option + 'Click'

Esc to exit selection.

MacOS: shift + alt/option + command + 'arrow key'



回答2:

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



回答3:

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

To create this in VS Code you can add these keybindings to the keybindings.json file (File -> Preferences -> Keyboard 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" }


回答4:

For multiple select in visual studio code, hold down the alt key and starting clicking wherever you wana edit. Visual studio code support multiple line edit



回答5:

On windows its holding down alt while box selecting. Once you have your selection then attempt your edit.