F1 或 Ctrl+Shift+P(俗称万能键) :打开命令面板。在打开的输入框内,可以输入任何命令,如下图(图片较大,如果查看不清晰,可以在图片上右键 “在新的标签页中打开图片”,查看原图,下同):
例如:
在 Ctrl+P 模式下输入 “ ?” 会弹出下拉菜单,如下图所示:
常用的如下:
? 列出当前可执行的动作
! 显示 Errors或 Warnings,也可以 Ctrl+Shift+M
: 跳转到行数,也可以 Ctrl+G 直接进入
@ 跳转到 symbol(搜索变量或者函数),也可以 Ctrl+Shift+O 直接进入
@ 根据分类跳转 symbol,查找属性或函数,也可以 Ctrl+Shift+O 后输入" : "进入
# 根据名字查找 symbol,也可以 Ctrl+T
自动保存:File -> AutoSave(中文界面下“文件”->“自动保存”) 或者 Ctrl+Shift+P,输入 auto
打开默认键盘快捷方式设置: File -> Preferences -> Keyboard Shortcuts( 中文界面时:“ 文件”->" 首选项"->" 键盘快捷方式"),或者:Alt+F -> p -> k -> Enter,进入后如下图一所示。
修改快捷键绑定方法一:直接在对应命令那一行点击,出现笔状图标,点击进入修改,如下图一所示:
图一
修改快捷键绑定方法二:点击搜索栏下侧的“ keybindings.json ”,进入编辑界面,如下图所示:
编写对应规则有一定的方法,如下所示:
// 将键绑定放入此文件中以覆盖默认值
[{
"key": "f8",
"command": "workbench.action.tasks.runTask",
"args": "build",
"when": "editorTextFocus"
}
] key 表示绑定的键 command 表示执行的命令 args 命令的参数,这里我们是build编译任务 when 快捷键在何时生效,这里指的是编辑区
保存完,你尝试按下F8,任务便顺利运行了。
自己的" keybindings.json "文件参考如下(谨慎使用):
// Place your key bindings in this file to overwrite the defaults
[
// ctrl+space 被切换输入法快捷键占用
{
"key": "ctrl+alt+space",
"command": "editor.action.triggerSuggest",
"when": "editorTextFocus"
},
// ctrl+d 删除一行
{
"key": "ctrl+d",
"command": "editor.action.deleteLines",
"when": "editorTextFocus"
},
// 与删除一行的快捷键互换
{
"key": "ctrl+shift+k",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
// ctrl+shift+/多行注释
{
"key":"ctrl+shift+/",
"command": "editor.action.blockComment",
"when": "editorTextFocus"
},
// 定制与 sublime 相同的大小写转换快捷键
editor.action.transformToLowercase
editor.action.transformToUppercase
{
"key": "ctrl+k ctrl+u",
"command": "editor.action.transformToUppercase"
"when": "editorTextFocus"
},
{
"key": "ctrl+k ctrl+l",
"command": "editor.action.transformToLowercase"
"when": "editorTextFocus"
}
]
参考文档:https://lzw.me/a/vscode-visual-studio-code-shortcut.html
官方快捷键大全:https://code.visualstudio.com/docs/getstarted/keybindings
备注 | 修改日期 | 修改人 |
格式调整 | 2020-09-29 16:58:46[当前版本] | 系统管理员 |
格式调整 | 2020-09-29 16:49:31 | 系统管理员 |
CREAT | 2020-09-29 16:44:43 | 系统管理员 |
附件类型 |
|
|
|