-
1、找到快捷键的配置文件
打开 VS Code,按
Cmd + Shift + P
,搜索 "Preferences: Open Keyboard Shortcuts (JSON)" 并打开 keybindings.json。 2、修改配置文件
添加如下配置
{
"key": "cmd+/",
"command": "runCommands",
"args": {
"commands": [
"editor.action.commentLine",
"cursorDown"
]
},
"when": "editorTextFocus"
}
3、保存
-
4、配置文件修改前后对比
修改前
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+y",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "shift+cmd+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
}
]
修改后
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+y",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "shift+cmd+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "cmd+/",
"command": "runCommands",
"args": {
"commands": [
"editor.action.commentLine",
"cursorDown"
]
},
"when": "editorTextFocus"
}
]
Top comments (0)