Skip to content

Instantly share code, notes, and snippets.

@richarddwang
Last active March 7, 2023 08:12
Show Gist options
  • Save richarddwang/ae5cc3b1fc22d1af53d11298030d26a3 to your computer and use it in GitHub Desktop.
Save richarddwang/ae5cc3b1fc22d1af53d11298030d26a3 to your computer and use it in GitHub Desktop.
My custom VSCode keybindings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+alt+left",
"command": "-workbench.action.moveEditorToPreviousGroup"
},
{
"key": "alt+left",
"command": "cursorHome",
"when": "textInputFocus"
},
{
"key": "ctrl+alt+up",
"command": "-editor.action.insertCursorAbove",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+down",
"command": "-editor.action.insertCursorBelow",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+d",
"command": "-workbench.view.debug",
"when": "viewContainer.workbench.view.debug.enabled"
},
{
"key": "shift+alt+d",
"command": "cursorColumnSelectLeft",
"when": "textInputFocus"
},
{
"key": "shift+alt+left",
"command": "cursorHomeSelect",
"when": "textInputFocus"
},
{
"key": "shift+home",
"command": "-cursorHomeSelect",
"when": "textInputFocus"
},
{
"key": "alt+right",
"command": "cursorEnd",
"when": "textInputFocus"
},
{
"key": "end",
"command": "-cursorEnd",
"when": "textInputFocus"
},
{
"key": "shift+alt+right",
"command": "cursorEndSelect",
"when": "textInputFocus"
},
{
"key": "shift+end",
"command": "-cursorEndSelect",
"when": "textInputFocus"
},
{
"key": "ctrl+alt+right",
"command": "-workbench.action.moveEditorToNextGroup"
},
{
"key": "home",
"command": "cursorTop",
"when": "textInputFocus"
},
{
"key": "ctrl+home",
"command": "-cursorTop",
"when": "textInputFocus"
},
{
"key": "shift+home",
"command": "cursorTopSelect",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+home",
"command": "-cursorTopSelect",
"when": "textInputFocus"
},
{
"key": "end",
"command": "cursorBottom",
"when": "textInputFocus"
},
{
"key": "ctrl+end",
"command": "-cursorBottom",
"when": "textInputFocus"
},
{
"key": "shift+end",
"command": "cursorBottomSelect",
"when": "textInputFocus"
},
{
"key": "ctrl+shift+end",
"command": "-cursorBottomSelect",
"when": "textInputFocus"
},
{
"key": "alt+oem_2",
"command": "breadcrumbs.focusAndSelect",
"when": "breadcrumbsPossible && breadcrumbsVisible"
},
{
"key": "ctrl+shift+oem_period",
"command": "-breadcrumbs.focusAndSelect",
"when": "breadcrumbsPossible && breadcrumbsVisible"
},
{
"key": "ctrl+f",
"command": "-actions.find",
"when": "editorFocus || editorIsOpen"
},
{
"key": "ctrl+shift+f",
"command": "-workbench.action.findInFiles"
},
{
"key": "ctrl+shift+f",
"command": "workbench.action.replaceInFiles"
},
{
"key": "ctrl+shift+h",
"command": "-workbench.action.replaceInFiles"
},
{
"key": "ctrl+f",
"command": "editor.action.startFindReplaceAction",
"when": "editorFocus || editorIsOpen"
},
{
"key": "ctrl+h",
"command": "-editor.action.startFindReplaceAction",
"when": "editorFocus || editorIsOpen"
},
{
"key": "alt+f",
"command": "workbench.action.gotoSymbol"
},
{
"key": "ctrl+shift+o",
"command": "-workbench.action.gotoSymbol"
},
{
"key": "shift+alt+f",
"command": "workbench.action.showAllSymbols"
},
{
"key": "ctrl+t",
"command": "-workbench.action.showAllSymbols"
},
{
"key": "alt+s",
"command": "workbench.action.files.saveWithoutFormatting"
},
{
"key": "ctrl+k ctrl+shift+s",
"command": "-workbench.action.files.saveWithoutFormatting"
},
{
"key": "ctrl+s",
"command": "workbench.action.files.save"
},
{
"key": "ctrl+s",
"command": "-workbench.action.files.save"
},
{
"key": "ctrl+shift+d",
"command": "editor.action.addSelectionToPreviousFindMatch"
},
{
"key": "shift+alt+d",
"command": "editor.action.moveSelectionToPreviousFindMatch"
},
{
"key": "alt+d",
"command": "editor.action.moveSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "ctrl+k ctrl+d",
"command": "-editor.action.moveSelectionToNextFindMatch",
"when": "editorFocus"
},
{
"key": "alt+r",
"command": "editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
},
{
"key": "f2",
"command": "-editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
},
{
"key": "alt+j",
"command": "editor.action.goToReferences",
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "shift+f12",
"command": "-editor.action.goToReferences",
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "ctrl+j",
"command": "editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "f12",
"command": "-editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+h",
"command": "editor.action.showHover",
"when": "editorTextFocus"
},
{
"key": "ctrl+k ctrl+i",
"command": "-editor.action.showHover",
"when": "editorTextFocus"
},
{
"key": "f5",
"command": "jupyter.restartkernel"
},
{
"key": "f5",
"command": "jupyter.notebookeditor.restartkernel"
},
{
"key": "alt+,",
"command": "workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "ctrl+alt+-",
"command": "-workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "alt+.",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "ctrl+shift+-",
"command": "-workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "alt+l",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+right",
"command": "-editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+alt+l",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "shift+alt+left",
"command": "-editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+r",
"command": "editor.action.refactor",
"when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+r",
"command": "-editor.action.refactor",
"when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment