在最后加上
,"override": true
才能让原有默认的快捷键被覆盖
好用的常用的快捷键自定义代码片段
[ //打开快捷键设置 { "key": "alt+shift+k", "command": "workbench.action.openGlobalKeybindings", "override": true }, //查找索引符号 { "key": "ctrl+shift+a", "command": "actions.quickFind", "override": true }, //置焦到项目管理器 { "key": "ctrl+shift+e", "command": "workbench.view.explorer", "override": true }, //复制标签卡到分栏 { "key": "ctrl+\\", "command": "workbench.action.copyEditor", "override": true }, //清空控制台 { "key": "ctrl+l", "command": "workbench.console.action.clearLog", "override": true }, { "key": "ctrl+shift+j", "command": "editor.action.joinLines", "override": true }, { "key": "shift+alt+x", "command": "workbench.files.action.collapseExplorerFolders", "override": true }, { "key": "alt+s", "command": "workbench.action.toggleAutoSave", "override": true }, { "key": "shift+alt+w", "command": "workbench.action.closeOtherEditors", "override": true }, { "key": "shift+alt+oem_6", "command": "workbench.action.closeEditorsToTheRight", "override": true }, { "key": "shift+alt+oem_4", "command": "workbench.action.closeEditorsToTheLeft", "override": true }, { "key": "ctrl+shift+pagedown", "command": "-workbench.action.moveEditorRightInGroup", "override": true }, { "key": "ctrl+shift+pagedown", "command": "workbench.action.moveEditorRightInGroup", "override": true }, { "key": "ctrl+numpad0", "command": "editor.action.fontZoomReset", "override": true }, { "key": "alt+e", "command": "workbench.action.switchWindow", "override": true }, { "key": "alt+insert", "command": "explorer.newFile", "override": true }, { "key": "shift+alt+insert", "command": "explorer.newFolder", "override": true }, { "key": "alt+enter", "command": "editor.action.quickFix", "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "override": true }, { "key": "ctrl+oem_period", "command": "-editor.action.quickFix", "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "override": true }, { "key": "ctrl+shift+oem_3", "command": "-workbench.action.terminal.new", "when": "terminalProcessSupported", "override": true }, { "key": "shift+alt+z", "command": "workbench.action.terminal.newInActiveWorkspace", "override": true }, { "key": "ctrl+l", "command": "workbench.action.terminal.clear", "override": true }, { "key": "ctrl+alt+k", "command": "workbench.action.openGlobalKeybindings", "override": true }, { "key": "ctrl+shift+f", "command": "-vueBeautify.format", "when": "editorTextFocus && editorTextFocus && !editorReadonly && resourceLangId == 'vue'", "override": true }, { "key": "alt+m", "command": "editor.action.toggleMinimap", "override": true }, { "key": "alt+n", "command": "npm.focus", "override": true }, { "key": "shift shift", "command": "workbench.action.gotoSymbol", "override": true }, { "key": "ctrl+shift+o", "command": "-workbench.action.gotoSymbol", "override": true }, { "key": "shift+alt+l", "command": "editor.action.transformToLowercase", "override": true }, { "key": "shift+alt+u", "command": "editor.action.transformToUppercase", "override": true }, { "key": "alt+u", "command": "editor.action.transformToTitlecase", "override": true }, { "key": "alt+numpad_add", "command": "workbench.action.increaseViewSize", "override": true }, { "key": "alt+pagedown", "command": "workbench.action.terminal.resizePaneDown", "override": true }, { "key": "alt+numpad_subtract", "command": "workbench.action.decreaseViewSize", "override": true }, { "key": "alt+numpad0", "command": "workbench.action.evenEditorWidths", "override": true }, { "key": "alt+pageup", "command": "workbench.action.terminal.resizePaneUp", "override": true }, { "key": "ctrl+alt+s", "command": "extension.autoScssStruct", "override": true }, { "key": "alt+b", "command": "workbench.action.toggleStatusbarVisibility", "override": true }, { "key": "shift+alt+k", "command": "workbench.action.openGlobalKeybindingsFile", "override": true }, { "key": "alt+f", "command": "workbench.action.toggleZenMode", "override": true }, { "key": "alt+q", "command": "workbench.action.toggleActivityBarVisibility", "override": true }, { "key": "alt+oem_5", "command": "workbench.action.splitEditorDown", "override": true }, { "key": "alt+g", "command": "git.checkout", "override": true }, { "key": "ctrl+alt+r", "command": "workbench.files.action.refreshFilesExplorer", "override": true }, { "key": "alt+r", "command": "workbench.action.tasks.runTask", "override": true }, { "key": "alt+c", "command": "-extension.switchCSS", "override": true }, { "key": "alt+c", "command": "extension.switchCSS", "override": true }, { "key": "alt+x", "command": "extension.cssremNaNpx-switch-px", "override": true }, { "key": "alt+z", "command": "-extension.cssremNaNpx-switch-px", "override": true } ]