在 VS Code 中创建多个光标的键盘快捷键是什么?
在 VS Code 中创建多个光标的键盘快捷键是什么?
Ctrl+Alt+⬇ / ⬆可以在当前行上方或下方添加光标。虽然这个功能还不如Sublime或Brackets好用。但是在快捷键文件中,我没有找到类似于Sublime中Ctrl+D的功能。
Alt + Command
和向上或向下箭头。 - Leniel MaccaferriCtrl+Shift+Up/Down
。 - tobalrhttps://code.visualstudio.com/Updates
新版本(Visual Studio 0.3.0)支持更多的多光标功能。
Multi-cursor
Here's multi-cursor improvements that we've made.
⌘D selects the word at the cursor, or the next occurrence of the current selection.
⌘K ⌘D moves the last added cursor to next occurrence of the current selection.
The two actions pick up the matchCase and matchWholeWord settings of the find widget.
⌘U undoes the last cursor action, so if you added one cursor too many or made a mistake, press ⌘U to return to the previous cursor state.
Insert cursor above (⌥⌘↑) and insert cursor below (⌥⌘↓) now reveals the last added cursor, making it easier to work with multi-cursors spanning more than one screen height (i.e., working with 300 lines while only 80 fit in the screen).
选择多个光标的快捷方式变成了cmd + d(与Sublime Text相同)。
我们期望下一版本将支持更多关于多光标的便捷功能;)
Alt+Shift+{箭头}
将会在 VS Code V1.18.0 中复制当前行。 - Adarsh Madrecha在Ubuntu-MATE上出现相同问题,但你可以通过以下方法解决:
gsettings set org.mate.Marco.general mouse-button-modifier "<Super>"
按下 Alt + Command + Shift 可以在下一个选定实例处添加光标。例如,变量或函数名。
首先进入“键盘快捷键”,您可以通过按下Cmd+k然后Cmd+s(对于Windows用户,按下Ctrl+k然后Ctrl+s)来到达那里。
一旦您到达那里,请搜索“在上方添加光标”和“在下方添加光标”。您甚至可以为它们分配自己的快捷键。