在VS代码中创建多个光标的键盘快捷键是什么?


当前回答

首先转到“键盘快捷键”,您可以按Cmd+k然后按Cmd+s,或者对于Windows,按Ctrl+k然后按Ctrl+s。

到达后,搜索“在上方添加光标”和“在下方添加光标”。您甚至可以为它们分配自己的密钥绑定。

其他回答

https://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.lol相同)

我们可以预期,下一个版本支持关于多光标的更方便的功能;)

Ctrl+Alt+⬇ / ⬆ 在当前行的上方和下方添加光标。然而,仍然远不及崇高或括号那么好。在键盘快捷键文件中,我看不到类似于升华中的Ctrl+D。

我遇到了ALT键的问题,修复方法是将ALT+click更改为Gnome热键,该热键在VSCode中阻止多光标选择,通过运行以下命令将其更改为super+click:

gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"   

资料来源:http://2buntu.com/articles/1529/visual-studio-code-comes-to-linux/

Alt+Click在OSX中有效。代码版本1.14.2

Alt+Command+Shift将向所选内容的下一个实例添加光标。例如,变量或函数名