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


当前回答

从Visual Studio代码0.10.9版开始,您现在可以通过选择多行并按Shift+Alt+I,从选定行创建多个光标

注意:这类似于Sublime Text的Ctrl+Shift+L功能。

资料来源:https://code.visualstudio.com/updates/vJanuary#_thank-你相关PR:https://github.com/Microsoft/vscode/pull/1479

其他回答

在Ubuntu MATE上也有同样的问题,但这里您可以通过以下方式解决:

gsettings set org.mate.Marco.general mouse-button-modifier "<Super>"

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相同)

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

从Visual Studio代码0.10.9版开始,您现在可以通过选择多行并按Shift+Alt+I,从选定行创建多个光标

注意:这类似于Sublime Text的Ctrl+Shift+L功能。

资料来源:https://code.visualstudio.com/updates/vJanuary#_thank-你相关PR:https://github.com/Microsoft/vscode/pull/1479

VS代码中的多字(和多行)光标/选择

多单词:

Windows/OS X:

按住Ctrl+Shift+L/¨+Shift+L选择当前高亮显示单词的所有实例Ctrl+D/¨+D选择下一个实例。。。之后的那个。。。等

多行:

对于多行选择,Ctrl+Alt+Down/¨+Alt+Shift+Down将将您的选择或光标位置扩展到下一行。Ctrl+Right/⑪+Right将移动到每行的末尾,无论多长时间。要退出多行选择,请按Esc。

请参阅VS代码密钥绑定(与操作系统相关)

在XFCE上,转到应用程序->设置->设置编辑器->xfwm4->easy_click(禁用值)

现在您可以使用Alt+Click插入光标

我还在“设置”->“窗口管理器”->“键盘”中禁用了L/R工作区(ctrl+alt+L/R)设置