找到你要的答案

Q:Multiline editing in VSCode

Q:在VSCode多行编辑

Is it possible to enable multiline editing like in Sublimetext?

Eg. press ctrl to place additional cursor carets and being able write/delete on multiple places in document at one time.

它是可能的多行编辑喜欢sublimetext使?

如按Ctrl将额外的光标插入符能写/同时在多个地方删除文件。

answer1: 回答1:

On Windows, you hold Ctrl+Alt while pressing the up ↑ or down ↓ arrow keys to add cursors. On Mac and Linux, the equivalents are ⌥ Opt+⌘ Cmd+↑/↓ and Shift+Alt+↑/↓, respectively.

Press Esc to reset to a single cursor.

Or, as Isidor Nikolic points out, you can hold Alt and left click to place cursors arbitrarily.

You can view and edit keyboard shortcuts via:

File → Preferences → Keyboard Shortcuts

Documentation:

https://code.visualstudio.com/docs/customization/keybindings

Official VSCode Keyboard shortcut cheatsheets:

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

在Windows中,你持有的Ctrl + Alt同时按上下箭头键↑或↓添加光标。在Mac和Linux,等同于⌥OPT +⌘Cmd的+↑/↓和Shift + Alt +↑/↓,分别。

按ESC键复位到一个单一的光标。

或者,正如Isidor Nikolic所指出的,你可以按住Alt键的同时点击左键把光标任意。

您可以查看和编辑键盘快捷方式通过:

文件→偏好→键盘快捷键

文档:

https://code.visualstudio.com/docs/customization/keybindings

官员VSCode Keyboard快捷的备忘单:

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf

answer2: 回答2:

You can just alt + click for additional cursors. And as already mentioned Ctrl + Alt + ↑ or ↓

你可以点击其他游标。正如已经提到的Ctrl + Alt +↑或↓

answer3: 回答3:

On Mac it is:

option + command while pressing the up ↑ or down ↓ arrow keys

在Mac上:

期权+命令的同时按下了↓↑或下箭头键

answer4: 回答4:

(Windows 10 pro x64) Here have some ways!

  1. alt + click

  2. alt + ctrl + up/down

  3. keybindings : ctrl + click (??? it doesn't work!)

(Windows 10 Pro x64)这里有一些方法!

  1. 按住ALT键

  2. Alt + Ctrl +上/下

  3. 快捷键:按住Ctrl键的同时单击(???这不起作用!)

answer5: 回答5:

Box Selecting

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

macOS : 'shift' + 'option' + Click

Contrary as mentioned here http://stackoverflow.com/questions/30384442/does-visual-studio-code-have-box-select-multi-line-edit/36650448#36650448

框中选择

窗户:“Shift”+“Alt +鼠标左键”

MacOS:“Shift”+“”+单击选项

Contrary as mentioned here http://stackoverflow.com/questions/30384442/does-visual-studio-code-have-box-select-multi-line-edit/36650448#36650448

answer6: 回答6:

I am using the vscodevim extension, so I'm not sure if this is a common problem. But, I was having the issue where Ctrl+Alt+UpArrow flipped my screen upside down.

Looking at the VSCode Basics (Idk if they changed this in a recent update), it says to use: Ctrl + Alt + Shift + (Up/down Arrow)

Hope this helps!

我用vscodevim延伸,所以我不知道如果这是一个常见的问题。但是,我是有问题,按Ctrl + Alt +向上的箭头把我的屏幕上。

Looking at the VSCode Basics (Idk if they changed this in a recent update), it says to use: Ctrl + Alt + Shift + (Up/down Arrow)

希望这有助于!

answer7: 回答7:

I think it depends on your VSCODE version.

Mine is Linux version vscode 1.7.2

{ "key": "ctrl+shift+up", "command": "editor.action.insertCursorAbove", "when": "editorTextFocus" }, { "key": "shift+alt+up", "command": "editor.action.insertCursorAbove", "when": "editorTextFocus" }, { "key": "ctrl+shift+down", "command": "editor.action.insertCursorBelow", "when": "editorTextFocus" }, { "key": "shift+alt+down", "command": "editor.action.insertCursorBelow", "when": "editorTextFocus" }

The point is the shortcuts are not same in all machines, so you should check your configuration. Go to menu:

File → Preferences → Keyboard Shortcuts

Search for editor.action.insertCursorAbove and editor.action.insertCursorBelow and see your current configurations. You may change them if they conflict with operating system's shortcut keys.

我认为这取决于你vscode版。

我的Linux版本vscode 1.7.2

{ "key": "ctrl+shift+up", "command": "editor.action.insertCursorAbove", "when": "editorTextFocus" }, { "key": "shift+alt+up", "command": "editor.action.insertCursorAbove", "when": "editorTextFocus" }, { "key": "ctrl+shift+down", "command": "editor.action.insertCursorBelow", "when": "editorTextFocus" }, { "key": "shift+alt+down", "command": "editor.action.insertCursorBelow", "when": "editorTextFocus" }

关键是所有机器的快捷方式不一样,所以你应该检查你的配置。转到菜单:

文件→偏好→键盘快捷键

对于editor.action.insertcursorabove和editor.action.insertcursorbelow搜索并查看您当前的配置。如果与操作系统的快捷键冲突,则可以更改它们。

vscode