Skip to content

Instantly share code, notes, and snippets.

@terryyounghk
Created March 7, 2024 05:15
Show Gist options
  • Save terryyounghk/55464008641e05afc45942e0943af2fa to your computer and use it in GitHub Desktop.
Save terryyounghk/55464008641e05afc45942e0943af2fa to your computer and use it in GitHub Desktop.
VsCode User Keyboard Shortcuts

Custom Keybindings for VsCode

These are keybindings for VsCode tailor-made to work with the combo-mods defined in https://github.com/terryyounghk/zmk-config

The VsCode built-in sync features is not necessarily work-environment friendly in my case: personal accounts are restricted in work machines, and work accounts are restricted in personal machines.

This file is to be used to manually import/export the shortcut settings instead.

Some shortcuts require certain VsCode Extensions to work.

[
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+shift+alt+cmd+v ctrl+shift+alt+cmd+v",
"command": "toggleVim"
},
{
"key": "shift+alt+k",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+j",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+j",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+k",
"command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+l cmd+a",
"command": "vscode-double-line-numbers.abs"
},
{
"key": "cmd+l cmd+x",
"command": "vscode-double-line-numbers.abs_rel"
},
{
"key": "cmd+l cmd+o",
"command": "vscode-double-line-numbers.off"
},
{
"key": "cmd+l cmd+r",
"command": "vscode-double-line-numbers.rel"
},
{
"key": "ctrl+,",
"command": "workbench.action.navigateBackInNavigationLocations"
},
{
"key": "ctrl+.",
"command": "workbench.action.navigateForwardInNavigationLocations"
},
{
"key": "cmd+k cmd+;",
"command": "editor.unfoldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k v",
"command": "-markdown.showPreviewToSide",
"when": "!notebookEditorFocused && editorLangId == 'markdown'"
},
{
"key": "cmd+k v",
"command": "-preview.showPreviewToSide",
"when": "!notebookEditorFocused && !terminalFocus"
},
{
"key": "ctrl+shift+alt+cmd+r",
"command": "markdown.showPreviewToSide"
},
{
"key": "ctrl+shift+alt+cmd+w",
"command": "openEditors.closeAll"
},
{
"key": "cmd+m cmd+l",
"command": "workbench.action.moveEditorToRightGroup"
},
{
"key": "cmd+m cmd+h",
"command": "workbench.action.moveEditorToLeftGroup"
},
{
"key": "cmd+m cmd+k",
"command": "workbench.action.moveEditorToAboveGroup"
},
{
"key": "cmd+m cmd+j",
"command": "workbench.action.moveEditorToBelowGroup"
},
{
"key": "cmd+d cmd+j",
"command": "workbench.action.joinAllGroups"
},
{
"key": "ctrl+shift+alt+cmd+v ctrl+shift+alt+cmd+c",
"command": "vim.showQuickpickCmdLine"
},
{
"key": "ctrl+shift+alt+cmd+v ctrl+shift+alt+cmd+e",
"command": "vim.editVimrc"
},
{
"key": "alt+cmd+s",
"command": "-saveAll"
},
{
"key": "shift+cmd+a",
"command": "workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "alt+cmd+k",
"command": "editor.emmet.action.incrementNumberByOne"
},
{
"key": "alt+cmd+j",
"command": "editor.emmet.action.decrementNumberByOne"
},
{
"key": "alt+cmd+l",
"command": "workbench.action.editor.nextChange",
"when": "editorTextFocus && !textCompareEditorActive"
},
{
"key": "alt+cmd+l",
"command": "workbench.action.compareEditor.nextChange",
"when": "textCompareEditorVisible"
},
{
"key": "alt+cmd+h",
"command": "workbench.action.compareEditor.previousChange",
"when": "textCompareEditorVisible"
},
{
"key": "ctrl+shift+alt+cmd+s",
"command": "workbench.action.files.saveFiles"
},
{
"key": "alt+h",
"command": "-extension.dash.customSyntax",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+right",
"command": "workbench.action.focusNextGroup"
},
{
"key": "ctrl+shift+alt+cmd+g",
"command": "git-graph.view"
},
{
"key": "alt+l",
"command": "toggleSearchEditorContextLines",
"when": "inSearchEditor"
},
{
"key": "alt+cmd+l",
"command": "-toggleSearchEditorContextLines",
"when": "inSearchEditor"
},
{
"key": "ctrl+shift+alt+b",
"command": "editor.action.jumpToBracket",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+alt+cmd+tab",
"command": "workbench.action.showAllEditorsByMostRecentlyUsed"
},
{
"key": "ctrl+shift+alt+n",
"command": "workbench.action.decreaseViewWidth"
},
{
"key": "ctrl+shift+alt+.",
"command": "workbench.action.increaseViewWidth"
},
{
"key": "ctrl+shift+alt+,",
"command": "workbench.action.decreaseViewHeight"
},
{
"key": "ctrl+shift+alt+m",
"command": "workbench.action.increaseViewHeight"
},
{
"key": "cmd+y cmd+l",
"command": "workbench.action.nextPanelView"
},
{
"key": "cmd+y cmd+h",
"command": "workbench.action.previousPanelView"
},
{
"key": "cmd+y cmd+k",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "ctrl+shift+alt+m",
"command": "workbench.action.terminal.resizePaneDown",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+cmd+down",
"command": "-workbench.action.terminal.resizePaneDown",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+shift+alt+,",
"command": "workbench.action.terminal.resizePaneUp",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+cmd+up",
"command": "-workbench.action.terminal.resizePaneUp",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+shift+alt+/",
"command": "workbench.action.toggleEditorWidths"
},
{
"key": "ctrl+alt+left",
"command": "workbench.action.focusPreviousGroup"
},
{
"key": "ctrl+alt+up",
"command": "workbench.action.focusActiveEditorGroup"
},
{
"key": "cmd+k cmd+h",
"command": "editor.foldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+K",
"command": "workbench.action.terminal.clear",
"when": "terminalFocus"
},
{
"key": "ctrl+shift+t",
"command": "surround.with.comment"
},
{
"key": "shift+alt+cmd+v",
"command": "workbench.action.editorDictation.stop",
"when": "editorDictation.inProgress"
},
{
"key": "ctrl+shift+alt+cmd+d",
"command": "todo-tree-view.toggleVisibility",
"when": "view.workbench.scm.visible"
},
{
"key": "ctrl+shift+alt+cmd+d",
"command": "todo-tree-view.focus",
"when": "!view.workbench.scm.visible"
},
{
"key": "ctrl+shift+alt+cmd+a",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "ctrl+shift+alt+cmd+b",
"command": "gitlens.toggleFileBlame",
"when": "editorTextFocus && config.gitlens.keymap == 'chorded' && gitlens:activeFileStatus =~ /blameable/"
},
{
"key": "ctrl+shift+alt+cmd+n",
"command": "workbench.action.evenEditorWidths"
},
{
"key": "ctrl+shift+alt+n",
"command": "workbench.action.terminal.resizePaneLeft",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+shift+alt+.",
"command": "workbench.action.terminal.resizePaneRight",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+shift+alt+cmd+left",
"command": "workbench.action.moveEditorLeftInGroup"
},
{
"key": "ctrl+shift+alt+cmd+right",
"command": "workbench.action.moveEditorRightInGroup"
},
{
"key": "ctrl+shift+alt+cmd+4",
"command": "workbench.action.splitEditorLeft"
},
{
"key": "ctrl+shift+alt+cmd+6",
"command": "workbench.action.splitEditorRight"
},
{
"key": "ctrl+shift+alt+cmd+8",
"command": "workbench.action.splitEditorUp"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorUp"
},
{
"key": "ctrl+shift+alt+cmd+2",
"command": "workbench.action.splitEditorDown"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorDown"
},
{
"key": "alt+cmd+h",
"command": "workbench.action.editor.previousChange",
"when": "editorTextFocus && !textCompareEditorActive"
},
{
"key": "shift+cmd+0",
"command": "workbench.action.zoomReset"
},
{
"key": "shift+alt+cmd+j",
"command": "editor.emmet.action.decrementNumberByTen"
},
{
"key": "shift+alt+cmd+k",
"command": "editor.emmet.action.incrementNumberByTen"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment