我听说微软发布了一款名为 Visual Studio Code 的新编辑器,看起来相当不错。我需要的一个关键功能是多行编辑,我似乎找不到任何关于它有它。
按 Ctrl + Alt + Down或 Ctrl + Alt + Up插入光标低于或高于。
对于 VisualStudio 代码中的多个选择,按住 Alt键并开始单击要编辑的任何位置。
VisualStudio 代码支持多行编辑。
在 Windows 上,它在选择框时按住 Alt。一旦你选择了,然后尝试编辑。
选择框
Windows & Linux: Shift + Alt + “鼠标左键”
MacOS: Shift + option + “ Click”
Esc退出选择。
MacOS: Shift + Alt/Option + Command +’箭头键’
我在 Visual Studio for multiline (aka box) select 中使用的快捷方式是 Shift + Alt + up/down/left/right
要在 Visual Studio Code 中创建这个,您可以将这些 keybindings 添加到 keybindings.json 文件(菜单 档案 & rarr; 偏好 & rarr; 键盘快捷键)。
{ "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" }