Skip to content

Instantly share code, notes, and snippets.

@3v1n0
Last active April 23, 2025 20:06
Show Gist options
  • Save 3v1n0/b5f34a4e139d17c9e0d2656a9b9b7fb7 to your computer and use it in GitHub Desktop.
Save 3v1n0/b5f34a4e139d17c9e0d2656a9b9b7fb7 to your computer and use it in GitHub Desktop.

Revisions

  1. 3v1n0 revised this gist Oct 22, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions keybindings.json
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,12 @@
    *
    * All these can be mixed with Ctrl or Shift, where relevant for selection
    * or just to do the same you'd do with <AnyModifier>+<Arrow>
    *
    * This can be generated for newer versions using:
    * vscode-keybindings-alt+hjkl-zation.py <path-to-default-vscode-keybindings.json>
    *
    * Available at:
    * https://gist.github.com/3v1n0/f5f05005811669d81155abe0826477c8
    */
    [
    /* Optional, use arrow-keys for navingating on search history entries */
  2. 3v1n0 renamed this gist Feb 26, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. 3v1n0 created this gist Feb 26, 2018.
    272 changes: 272 additions & 0 deletions Untitled-1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,272 @@
    /* VSCode keybindings for alternative HJLK navigation, when using non-vim mode
    * and support for quick panel navigation with Tab/Shift+Tab.
    *
    * So basically I just tried to use everywhere in the editor these aliases:
    * Alt+j = down
    * Alt+k = up
    * Alt+l = right
    * Alt+h = left
    * Alt+b = previous-word
    * Alt+w = next-word
    * Alt+u = previous-page
    * Alt+n = next-page
    *
    * All these can be mixed with Ctrl or Shift, where relevant for selection
    * or just to do the same you'd do with <AnyModifier>+<Arrow>
    */
    [
    /* Optional, use arrow-keys for navingating on search history entries */
    {
    "key": "up",
    "command": "find.history.showPrevious",
    "when": "editorFocus && findInputFocussed && findWidgetVisible"
    },
    {
    "key": "up",
    "command": "workbench.action.terminal.findWidget.history.showPrevious",
    "when": "terminalFindWidgetInputFocused && terminalFindWidgetVisible"
    },
    {
    "key": "down",
    "command": "find.history.showNext",
    "when": "editorFocus && findInputFocussed && findWidgetVisible"
    },
    {
    "key": "down",
    "command": "workbench.action.terminal.findWidget.history.showNext",
    "when": "terminalFindWidgetInputFocused && terminalFindWidgetVisible"
    },

    /* Tab and Shift+Tab support in QuickOpen panel (command palette) */
    {
    "key": "tab",
    "command": "workbench.action.quickOpenSelectNext",
    "when": "inQuickOpen"
    },
    {
    "key": "tab",
    "command": "workbench.action.quickOpenSelectNext",
    /* Catches Quick Picker, need better see github issue */
    "when": "inputFocus && !editorFocus && !findInputFocussed && !findWidgetVisible"
    },
    {
    "key": "shift+tab",
    "command": "workbench.action.quickOpenSelectPrevious",
    "when": "inQuickOpen"
    },
    {
    "key": "shift+tab",
    "command": "workbench.action.quickOpenSelectPrevious",
    /* Catches Quick Picker, need better see github issue */
    "when": "inputFocus && !editorFocus && !findInputFocussed && !findWidgetVisible"
    },

    /* alt+[shift]+hjkl support together with arrows support */
    {
    "key": "alt+j",
    "command": "workbench.action.quickOpenSelectNext",
    /* Catches Quick Picker, need better see github issue */
    "when": "inputFocus && !editorFocus && !findInputFocussed && !findWidgetVisible"
    },
    {
    "key": "alt+k",
    "command": "workbench.action.quickOpenSelectPrevious",
    /* Catches Quick Picker, need better see github issue */
    "when": "inputFocus && !editorFocus && !findInputFocussed && !findWidgetVisible"
    },
    {
    "key": "alt+h",
    "command": "cursorLeft",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+j",
    "command": "cursorDown",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+k",
    "command": "cursorUp",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+l",
    "command": "cursorRight",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+h",
    "command": "cursorLeftSelect",
    "when": "editorTextFocus"
    },
    {
    "command": "cursorDownSelect",
    "key": "alt+shift+j",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+k",
    "command": "cursorUpSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+l",
    "command": "cursorRightSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+b",
    "command": "cursorWordStartLeft",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+w",
    "command": "cursorWordEndRight",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+b",
    "command": "cursorWordStartLeftSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+w",
    "command": "cursorWordEndRightSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+u",
    "command": "cursorPageUp",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+n",
    "command": "cursorPageDown",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+u",
    "command": "cursorPageUpSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+shift+n",
    "command": "cursorPageDownSelect",
    "when": "editorTextFocus"
    },
    {
    "key": "ctrl+shift+alt+k",
    "command": "editor.action.moveLinesUpAction",
    "when": "editorTextFocus"
    },
    {
    "key": "ctrl+shift+alt+j",
    "command": "editor.action.moveLinesDownAction",
    "when": "editorTextFocus"
    },
    {
    "key": "alt+j",
    "command": "repl.action.historyNext",
    "when": "editorTextFocus && inDebugRepl && onLastDebugReplLine"
    },
    {
    "key": "alt+j",
    "command": "settings.action.focusSettingsFile",
    "when": "inSettingsSearch"
    },
    {
    "key": "alt+j",
    "command": "showNextParameterHint",
    "when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
    },
    {
    "key": "alt+j",
    "command": "selectNextSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
    },
    {
    "key": "alt+j",
    "command": "keybindings.editor.focusKeybindings",
    "when": "inKeybindings && inKeybindingsSearch"
    },
    {
    "key": "alt+j",
    "command": "list.focusDown",
    "when": "listFocus && !inputFocus"
    },
    {
    "key": "alt+j",
    "command": "search.focus.nextInputBox",
    "when": "inputBoxFocus && searchViewletVisible"
    },
    {
    "key": "alt+j",
    "command": "workbench.action.interactivePlayground.arrowDown",
    "when": "interactivePlaygroundFocus && !editorTextFocus"
    },
    {
    "key": "alt+k",
    "command": "repl.action.historyPrevious",
    "when": "editorTextFocus && inDebugRepl && onFirsteDebugReplLine"
    },
    {
    "key": "alt+k",
    "command": "showPrevParameterHint",
    "when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
    },
    {
    "key": "alt+k",
    "command": "selectPrevSuggestion",
    "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
    },
    {
    "key": "alt+k",
    "command": "list.focusUp",
    "when": "listFocus && !inputFocus"
    },
    {
    "key": "alt+k",
    "command": "search.action.focusSearchFromResults",
    "when": "firstMatchFocus && searchViewletVisible"
    },
    {
    "key": "alt+k",
    "command": "search.focus.previousInputBox",
    "when": "inputBoxFocus && searchViewletVisible && !searchInputBoxFocus"
    },
    {
    "key": "alt+k",
    "command": "workbench.action.interactivePlayground.arrowUp",
    "when": "interactivePlaygroundFocus && !editorTextFocus"
    },
    {
    "key": "alt+k",
    "command": "find.history.showPrevious",
    "when": "editorFocus && findInputFocussed && findWidgetVisible"
    },
    {
    "key": "alt+k",
    "command": "workbench.action.terminal.findWidget.history.showPrevious",
    "when": "terminalFindWidgetInputFocused && terminalFindWidgetVisible"
    },
    {
    "key": "alt+j",
    "command": "workbench.action.quickOpenSelectNext",
    "when": "inQuickOpen"
    },
    {
    "key": "alt+k",
    "command": "workbench.action.quickOpenSelectPrevious",
    "when": "inQuickOpen"
    },
    {
    "key": "alt+j",
    "command": "workbench.action.compareEditor.nextChange",
    "when": "textCompareEditorVisible && !findInputFocussed"
    },
    {
    "key": "alt+k",
    "command": "workbench.action.compareEditor.previousChange",
    "when": "textCompareEditorVisible && !findInputFocussed"
    },
    ]