Skip to content

Instantly share code, notes, and snippets.

@cschleiden
Last active October 19, 2022 15:54
Show Gist options
  • Save cschleiden/4dbc22a5711f069199a0cc730ac42cb5 to your computer and use it in GitHub Desktop.
Save cschleiden/4dbc22a5711f069199a0cc730ac42cb5 to your computer and use it in GitHub Desktop.
emacs-like navigation keybindings for VS Code
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
// 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": "alt+p",
"command": "cursorPageUp",
"when": "editorTextFocus"
},
{
"key": "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"
},
// Search
{
"key": "ctrl+alt+f",
"command": "workbench.action.findInFiles"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment