-
-
Save richellyitalo/dafea07dc720a37bd00de8fe1d65359d to your computer and use it in GitHub Desktop.
VSCode keybindings for alternative HJLK navigation, when using non-vim mode and support for quick panel navigation with Tab/Shift+Tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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" | |
}, | |
// Custom Start and Endline | |
{ | |
"key": "alt+shift+4", | |
"command": "cursorEnd", | |
"when": "textInputFocus" | |
}, | |
{ | |
"key": "alt+shift+4", | |
"command": "list.focusLast", | |
"when": "listFocus && !inputFocus" | |
}, | |
{ | |
"key": "alt+shift+4", | |
"command": "notifications.focusLastToast", | |
"when": "notificationFocus && notificationToastsVisible" | |
}, | |
{ | |
"key": "alt+shift+'", | |
"command": "cursorHome", | |
"when": "textInputFocus" | |
}, | |
{ | |
"key": "alt+shift+'", | |
"command": "list.focusFirst", | |
"when": "listFocus && !inputFocus" | |
}, | |
{ | |
"key": "alt+shift+'", | |
"command": "notifications.focusFirstToast", | |
"when": "notificationFocus && notificationToastsVisible" | |
}, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment