Skip to content

Instantly share code, notes, and snippets.

@cschleiden
Created September 15, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cschleiden/83951ef763581478e81a44566111c779 to your computer and use it in GitHub Desktop.
Save cschleiden/83951ef763581478e81a44566111c779 to your computer and use it in GitHub Desktop.
VS Code Emacs-Like Keyboard Shortcuts
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+k ctrl+s",
"command": "saveAll",
"when": "editorTextFocus"
},
{
"key": "ctrl+p",
"command": "cursorUp"
},
{
"key": "ctrl+n",
"command": "cursorDown"
},
{
"key": "ctrl+f",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "ctrl+b",
"command": "cursorLeft",
"when": "editorTextFocus"
},
{
"key": "alt+f",
"command": "cursorWordRight",
"when": "editorTextFocus"
},
{
"key": "alt+b",
"command": "cursorWordLeft",
"when": "editorTextFocus"
},
{
"key": "alt+backspace",
"command": "deleteWordLeft",
"when": "editorTextFocus"
},
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "editorTextFocus"
},
{
"key": "ctrl+d",
"command": "deleteRight",
"when": "editorTextFocus"
},
{
"key": "alt+d",
"command": "deleteWordRight",
"when": "editorTextFocus"
},
{
"key": "ctrl+i",
"command": "actions.find"
},
{
"key": "ctrl+shift+t",
"command": "workbench.action.tasks.runTask",
"when": "editorTextFocus"
},
{
"key": "ctrl+,",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+alt+a",
"command": "editor.action.selectAll",
"when": "editorTextFocus"
},
// Navigation in code
{
"key": "ctrl+alt+p",
"command": "cursorPageUp",
"when": "editorTextFocus"
},
// note: work around mac issue with alt+n
{
"key": "ctrl+alt+n",
"command": "cursorPageDown",
"when": "editorTextFocus"
},
// Navigation in dialogs
{
"key": "ctrl+p",
"command": "showPrevParameterHint",
"when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "ctrl+p",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "ctrl+n",
"command": "showNextParameterHint",
"when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
// Selection
{
"key": "ctrl+shift+n",
"command": "cursorDownSelect"
},
{
"key": "ctrl+shift+p",
"command": "cursorUpSelect"
},
{
"key": "ctrl+shift+f",
"command": "cursorRightSelect"
},
{
"key": "ctrl+shift+b",
"command": "cursorLeftSelect"
},
{
"key": "ctrl+shift+e",
"command": "cursorEndSelect"
},
{
"key": "ctrl+shift+a",
"command": "cursorHomeSelect"
},
{
"key": "shift+alt+f",
"command": "cursorWordRightSelect"
},
{
"key": "shift+alt+b",
"command": "cursorWordLeftSelect"
},
// Search
{
"key": "ctrl+alt+f",
"command": "workbench.action.findInFiles"
},
{
"key": "ctrl+k",
"command": "-deleteAllRight",
"when": "textInputFocus && !editorReadonly"
},
// Mouse navigation
{
"key": "cmd+]",
"command": "workbench.action.navigateForward",
"when": "editorTextFocus"
},
{
"key": "cmd+[",
"command": "workbench.action.navigateBack",
"when": "editorTextFocus"
},
// go
{
"key": "shift+cmd+t",
"command": "go.toggle.test.file",
"when": "editorLangId == 'go'"
},
// Terminal
{
"key": "cmd+ctrl+t",
"command": "workbench.panel.terminal.focus"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment