在VS代码中创建多个光标的键盘快捷键是什么?
当前回答
Ctrl+Alt+⬇ / ⬆ 在当前行的上方和下方添加光标。然而,仍然远不及崇高或括号那么好。在键盘快捷键文件中,我看不到类似于升华中的Ctrl+D。
其他回答
2017年5月自1.13版起使用Ctrl/Cmd+单击添加多个光标
VSCode开发人员引入了一个新的设置editor.multiCursorModifier,以将应用多个光标的修改键更改为在macOS上的Cmd+Click和在Windows和Linux上的Ctrl+Click。这允许来自Sublime Text或Atom等其他编辑器的用户继续使用他们熟悉的键盘修改器。
设置可以设置为:
ctrl/Cmd-映射到Windows上的ctrl和macOS上的Cmd。alt-现有默认alt。
在“选择”菜单中还有一个新的菜单项“使用Ctrl+单击多光标”可快速切换此设置。
“转到定义”和“打开链接”手势也将尊重此设置并进行调整,以使它们不冲突。例如,当设置为ctrl/Cmd时,可以使用ctrl/Cmd+Click添加多个光标,并且可以使用Alt+Click调用打开链接或转到定义。
通过修复问题#2106,现在还可以通过在现有选择的顶部使用相同的手势来移除光标。
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相同)
我们可以预期,下一个版本支持关于多光标的更方便的功能;)
可以根据“选择”菜单执行以下操作:
根据需要按住Alt+Ctrl+向上箭头/Alt+Ctrl+向下箭头以创建足够的光标,然后可以使用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/
在Ubuntu上,为了启用多光标单击,您需要首先通过运行下面的命令重新分配Alt+click。这是因为默认情况下,Ubuntu使用快捷方式本身并具有优先权。
> gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
推荐文章
- 如何设置每个文件类型的标签大小?
- 我如何添加环境变量启动。VSCode中的json
- 如何格式化Visual Studio Code项目中的所有文件?
- Pylint在Visual Studio代码中“未解决的导入”错误
- 如何在VS Code中默认打开文本换行
- 在Visual Studio代码中更改突出显示文本的颜色
- Visual studio代码-键盘快捷键-全部展开/折叠
- Visual Studio Code无法检测已安装的Git
- 禁用Visual Studio代码中的工具提示提示
- Visual Studio Code -将空格转换为制表符
- 在VSCode中的列自动硬换行
- Visual Studio Code:格式没有使用缩进设置
- 如何排除文件扩展名和语言从“格式保存”在VSCode?
- Visual Studio代码- URI的目标不存在" package:flutter/material.dart "
- VSCode——如何设置调试Python程序的工作目录