Skip to content

Instantly share code, notes, and snippets.

@sdebnath
Last active December 4, 2023 19:57
Show Gist options
  • Save sdebnath/c5eb3d9a5c1ef5504e64c65a5e7cfe1d to your computer and use it in GitHub Desktop.
Save sdebnath/c5eb3d9a5c1ef5504e64c65a5e7cfe1d to your computer and use it in GitHub Desktop.
VSCode Key Bindings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+q",
"command": "editor.action.peekDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "alt+f12",
"command": "-editor.action.peekDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "ctrl+q",
"command": "-workbench.action.quickOpenNavigateNextInViewPicker",
"when": "inQuickOpen && inViewsPicker"
},
{
"key": "ctrl+q",
"command": "-workbench.action.quickOpenView"
},
{
"key": "ctrl+r",
"command": "-workbench.action.openRecent"
},
{
"key": "ctrl+r",
"command": "-workbench.action.terminal.runRecentCommand",
"when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+r",
"command": "-workbench.action.quickOpenNavigateNextInRecentFilesPicker",
"when": "inQuickOpen && inRecentFilesPicker"
},
{
"key": "ctrl+t",
"command": "references-view.findReferences",
"when": "editorHasReferenceProvider"
},
{
"key": "shift+alt+f12",
"command": "-references-view.findReferences",
"when": "editorHasReferenceProvider"
},
{
"key": "ctrl+t",
"command": "-editor.action.transposeLetters",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+r",
"command": "references-view.showCallHierarchy",
"when": "editorHasCallHierarchyProvider"
},
{
"key": "shift+alt+h",
"command": "-references-view.showCallHierarchy",
"when": "editorHasCallHierarchyProvider"
},
{
"key": "ctrl+r",
"command": "editor.showCallHierarchy",
"when": "editorHasCallHierarchyProvider && editorTextFocus && !inReferenceSearchEditor"
},
{
"key": "shift+alt+h",
"command": "-editor.showCallHierarchy",
"when": "editorHasCallHierarchyProvider && editorTextFocus && !inReferenceSearchEditor"
},
{
"key": "ctrl+b",
"command": "-cursorLeft",
"when": "textInputFocus"
},
{
"key": "ctrl+b",
"command": "workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "ctrl+-",
"command": "-workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "ctrl+shift+b",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "ctrl+shift+-",
"command": "-workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "ctrl+d",
"command": "-deleteRight",
"when": "textInputFocus"
},
{
"key": "ctrl+d",
"command": "editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "f12",
"command": "-editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+d",
"command": "editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && isWeb && !isInEmbeddedEditor"
},
{
"key": "cmd+f12",
"command": "-editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && isWeb && !isInEmbeddedEditor"
},
{
"key": "ctrl+j",
"command": "-editor.action.joinLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+j",
"command": "workbench.action.gotoLine"
},
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine"
},
{
"key": "ctrl+g",
"command": "editor.action.nextMatchFindAction",
"when": "editorFocus"
},
{
"key": "f3",
"command": "-editor.action.nextMatchFindAction",
"when": "editorFocus"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active && !gitlens:disabled && config.gitlens.keymap == 'chorded'"
},
{
"key": "ctrl+shift+g",
"command": "editor.action.previousMatchFindAction",
"when": "editorFocus"
},
{
"key": "shift+f3",
"command": "-editor.action.previousMatchFindAction",
"when": "editorFocus"
},
{
"key": "ctrl+shift+r",
"command": "-editor.action.refactor",
"when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+r",
"command": "-workbench.action.quickOpenNavigatePreviousInRecentFilesPicker",
"when": "inQuickOpen && inRecentFilesPicker"
},
{
"key": "cmd+f",
"command": "actions.find",
"when": "editorFocus || editorIsOpen"
},
{
"key": "cmd+f",
"command": "-actions.find",
"when": "editorFocus || editorIsOpen"
},
{
"key": "cmd+k cmd+c",
"command": "-editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+k m",
"command": "-workbench.action.editor.changeLanguageMode",
"when": "!notebookEditorFocused"
},
{
"key": "cmd+k alt+cmd+c",
"command": "-workbench.action.addComment"
},
{
"key": "cmd+k alt+cmd+down",
"command": "-editor.action.nextCommentingRange",
"when": "accessibilityModeEnabled && commentFocused || accessibilityModeEnabled && editorFocus || accessibilityHelpIsShown && accessibilityModeEnabled && accessibleViewCurrentProviderId == 'comments'"
},
{
"key": "cmd+k alt+cmd+up",
"command": "-editor.action.previousCommentingRange",
"when": "accessibilityModeEnabled && commentFocused || accessibilityModeEnabled && editorFocus || accessibilityHelpIsShown && accessibilityModeEnabled && accessibleViewCurrentProviderId == 'comments'"
},
{
"key": "cmd+k cmd+,",
"command": "-editor.createFoldingRangeFromSelection",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+i",
"command": "-editor.debug.action.showDebugHover",
"when": "editorTextFocus && inDebugMode"
},
{
"key": "cmd+k cmd+k",
"command": "-editor.action.defineKeybinding",
"when": "resource == 'vscode-userdata:/Users/sdn/Library/Application%20Support/Code/User/keybindings.json'"
},
{
"key": "cmd+k e",
"command": "-workbench.files.action.focusOpenEditorsView",
"when": "workbench.explorer.openEditorsView.active"
},
{
"key": "cmd+k c",
"command": "-workbench.files.action.compareWithClipboard"
},
{
"key": "cmd+k d",
"command": "-workbench.files.action.compareWithSaved"
},
{
"key": "cmd+k alt+cmd+c",
"command": "-copyFilePath",
"when": "editorFocus"
},
{
"key": "cmd+k shift+alt+cmd+c",
"command": "-copyRelativeFilePath",
"when": "editorFocus"
},
{
"key": "cmd+k o",
"command": "-workbench.action.files.showOpenedFileInNewWindow",
"when": "emptyWorkspaceSupport"
},
{
"key": "cmd+k s",
"command": "-workbench.action.files.saveWithoutFormatting"
},
{
"key": "cmd+k cmd+0",
"command": "-editor.foldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+/",
"command": "-editor.foldAllBlockComments",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+-",
"command": "-editor.foldAllExcept",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+8",
"command": "-editor.foldAllMarkerRegions",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+1",
"command": "-editor.foldLevel1",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+2",
"command": "-editor.foldLevel2",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+3",
"command": "-editor.foldLevel3",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+4",
"command": "-editor.foldLevel4",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+5",
"command": "-editor.foldLevel5",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+6",
"command": "-editor.foldLevel6",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+7",
"command": "-editor.foldLevel7",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+[",
"command": "-editor.foldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+f",
"command": "-editor.action.formatSelection",
"when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
},
{
"key": "cmd+k cmd+r",
"command": "-git.revertSelectedRanges",
"when": "isInDiffEditor && !operationInProgress"
},
{
"key": "cmd+k alt+cmd+s",
"command": "-git.stageSelectedRanges",
"when": "isInDiffEditor && !operationInProgress"
},
{
"key": "cmd+k cmd+n",
"command": "-git.unstageSelectedRanges",
"when": "isInDiffEditor && !operationInProgress"
},
{
"key": "cmd+k cmd+q",
"command": "-workbench.action.navigateToLastEditLocation"
},
{
"key": "cmd+k cmd+r",
"command": "-workbench.action.keybindingsReference"
},
{
"key": "cmd+k i",
"command": "-inlineChat.start",
"when": "inlineChatHasProvider && !editorReadonly"
},
{
"key": "cmd+k v",
"command": "-markdown.showPreviewToSide",
"when": "!notebookEditorFocused && editorLangId == 'markdown'"
},
{
"key": "cmd+k cmd+d",
"command": "-editor.action.moveSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "cmd+k cmd+c",
"command": "-notebook.cell.collapseCellInput",
"when": "notebookCellListFocused && !inputFocus && !notebookCellInputIsCollapsed"
},
{
"key": "cmd+k t",
"command": "-notebook.cell.collapseCellOutput",
"when": "notebookCellHasOutputs && notebookCellListFocused && !inputFocus && !notebookCellOutputIsCollapsed"
},
{
"key": "cmd+k cmd+c",
"command": "-notebook.cell.expandCellInput",
"when": "notebookCellInputIsCollapsed && notebookCellListFocused"
},
{
"key": "cmd+k t",
"command": "-notebook.cell.expandCellOutput",
"when": "notebookCellListFocused && notebookCellOutputIsCollapsed"
},
{
"key": "cmd+k shift+cmd+\\",
"command": "-notebook.cell.split",
"when": "editorTextFocus && notebookCellEditable && notebookEditable && notebookEditorFocused"
},
{
"key": "cmd+k y",
"command": "-notebook.cell.toggleOutputScrolling",
"when": "notebookCellHasOutputs && notebookCellListFocused && !inputFocus"
},
{
"key": "cmd+k shift+cmd+n",
"command": "-notifications.showList"
},
{
"key": "cmd+k f12",
"command": "-editor.action.revealDefinitionAside",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "cmd+k cmd+f12",
"command": "-editor.action.revealDefinitionAside",
"when": "editorHasDefinitionProvider && editorTextFocus && isWeb && !isInEmbeddedEditor"
},
{
"key": "cmd+k cmd+t",
"command": "-workbench.action.selectTheme"
},
{
"key": "cmd+k cmd+s",
"command": "-workbench.action.openGlobalKeybindings"
},
{
"key": "cmd+k cmd+u",
"command": "-editor.action.removeCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+k cmd+.",
"command": "-editor.removeManualFoldingRanges",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+k",
"command": "-editor.action.selectFromAnchorToCursor",
"when": "editorTextFocus && selectionAnchorSet"
},
{
"key": "cmd+k cmd+b",
"command": "-editor.action.setSelectionAnchor",
"when": "editorTextFocus"
},
{
"key": "cmd+k cmd+i",
"command": "-editor.action.showHover",
"when": "editorTextFocus"
},
{
"key": "cmd+k",
"command": "-workbench.action.terminal.clear",
"when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'"
},
{
"key": "cmd+k cmd+i",
"command": "-workbench.action.terminal.focusHover",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
},
{
"key": "cmd+k cmd+l",
"command": "-editor.toggleFold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+x",
"command": "-editor.action.trimTrailingWhitespace",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+k cmd+j",
"command": "-editor.unfoldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+=",
"command": "-editor.unfoldAllExcept",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+9",
"command": "-editor.unfoldAllMarkerRegions",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k cmd+]",
"command": "-editor.unfoldRecursively",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "cmd+k shift+cmd+w",
"command": "-workbench.action.closeAllGroups"
},
{
"key": "cmd+k cmd+w",
"command": "-workbench.action.closeAllEditors"
},
{
"key": "cmd+k w",
"command": "-workbench.action.closeEditorsInGroup"
},
{
"key": "cmd+k u",
"command": "-workbench.action.closeUnmodifiedEditors"
},
{
"key": "cmd+k cmd+up",
"command": "-workbench.action.focusAboveGroup"
},
{
"key": "cmd+k cmd+down",
"command": "-workbench.action.focusBelowGroup"
},
{
"key": "cmd+k cmd+left",
"command": "-workbench.action.focusLeftGroup"
},
{
"key": "cmd+k cmd+right",
"command": "-workbench.action.focusRightGroup"
},
{
"key": "cmd+k shift+cmd+\\",
"command": "-workbench.action.joinEditorInGroup",
"when": "sideBySideEditorActive"
},
{
"key": "cmd+k enter",
"command": "-workbench.action.keepEditor"
},
{
"key": "cmd+k down",
"command": "-workbench.action.moveActiveEditorGroupDown"
},
{
"key": "cmd+k left",
"command": "-workbench.action.moveActiveEditorGroupLeft"
},
{
"key": "cmd+k right",
"command": "-workbench.action.moveActiveEditorGroupRight"
},
{
"key": "cmd+k up",
"command": "-workbench.action.moveActiveEditorGroupUp"
},
{
"key": "cmd+k shift+cmd+left",
"command": "-workbench.action.moveEditorLeftInGroup"
},
{
"key": "cmd+k shift+cmd+right",
"command": "-workbench.action.moveEditorRightInGroup"
},
{
"key": "cmd+k alt+cmd+right",
"command": "-workbench.action.nextEditorInGroup"
},
{
"key": "cmd+k alt+cmd+left",
"command": "-workbench.action.previousEditorInGroup"
},
{
"key": "cmd+k shift+enter",
"command": "-workbench.action.pinEditor",
"when": "!activeEditorIsPinned"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorDown"
},
{
"key": "cmd+k shift+cmd+\\",
"command": "-workbench.action.splitEditorInGroup",
"when": "activeEditorCanSplitInGroup"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorLeft"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorOrthogonal"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorRight"
},
{
"key": "cmd+k cmd+\\",
"command": "-workbench.action.splitEditorUp"
},
{
"key": "cmd+k cmd+m",
"command": "-workbench.action.toggleMaximizeEditorGroup",
"when": "maximizedEditorGroup || multipleEditorGroups"
},
{
"key": "cmd+k z",
"command": "-workbench.action.toggleZenMode"
},
{
"key": "cmd+k shift+enter",
"command": "-workbench.action.unpinEditor",
"when": "activeEditorIsPinned"
},
{
"key": "cmd+k f",
"command": "-workbench.action.closeFolder",
"when": "emptyWorkspaceSupport && workbenchState != 'empty'"
},
{
"key": "cmd+k cmd+a",
"command": "-keybindings.editor.addKeybinding",
"when": "inKeybindings && keybindingFocus"
},
{
"key": "cmd+k cmd+e",
"command": "-keybindings.editor.defineWhenExpression",
"when": "inKeybindings && keybindingFocus"
},
{
"key": "cmd+k f2",
"command": "-togglePeekWidgetFocus",
"when": "inReferenceSearchEditor || referenceSearchVisible"
},
{
"key": "cmd+k down",
"command": "-views.moveViewDown",
"when": "focusedView != ''"
},
{
"key": "cmd+k left",
"command": "-views.moveViewLeft",
"when": "focusedView != ''"
},
{
"key": "cmd+k right",
"command": "-views.moveViewRight",
"when": "focusedView != ''"
},
{
"key": "cmd+k up",
"command": "-views.moveViewUp",
"when": "focusedView != ''"
},
{
"key": "cmd+k shift+o",
"command": "-workbench.action.compareEditor.openSide",
"when": "inDiffEditor"
},
{
"key": "cmd+k p",
"command": "-workbench.action.files.copyPathOfActiveFile"
},
{
"key": "cmd+k r",
"command": "-workbench.action.files.revealActiveFileInWindows"
},
{
"key": "cmd+k cmd+i",
"command": "-workbench.action.showTreeHover",
"when": "customTreeView && listFocus && !inputFocus"
},
{
"key": "cmd+b",
"command": "bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "alt+cmd+k",
"command": "-bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "shift+cmd+k",
"command": "bookmarks.listFromAllFiles"
},
{
"key": "cmd+k j",
"command": "bookmarks.jumpToNext",
"when": "editorTextFocus"
},
{
"key": "alt+cmd+l",
"command": "-bookmarks.jumpToNext",
"when": "editorTextFocus"
},
{
"key": "cmd+k k",
"command": "bookmarks.jumpToPrevious",
"when": "editorTextFocus"
},
{
"key": "alt+cmd+j",
"command": "-bookmarks.jumpToPrevious",
"when": "editorTextFocus"
},
{
"key": "cmd+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "backspace",
"command": "-deleteLeft",
"when": "textInputFocus"
},
{
"key": "backspace",
"command": "deleteLeft",
"when": "textInputFocus"
},
{
"key": "ctrl+h",
"command": "-deleteLeft",
"when": "textInputFocus"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment