Skip to content

Instantly share code, notes, and snippets.

@KorigamiK
Last active September 19, 2024 11:52
Show Gist options
  • Save KorigamiK/4d3231a3defce739f17b22a0d070c3bc to your computer and use it in GitHub Desktop.
Save KorigamiK/4d3231a3defce739f17b22a0d070c3bc to your computer and use it in GitHub Desktop.
vscode vim keybinds
// Place your key bindings in this file to override the defaultsauto[]
[
{
"command": "workbench.action.nextEditor",
"key": "shift+l",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"command": "workbench.action.previousEditor",
"key": "shift+h",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft",
"when": "(vim.mode != 'Insert' && editorTextFocus) || filesExplorerFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight",
"when": "vim.mode != 'Insert' && editorTextFocus"
},
{
"key": "ctrl+l",
"command": "cursorRight",
"when": "vim.mode == 'Insert' && editorTextFocus"
},
{
"key": "ctrl+h",
"command": "cursorLeft",
"when": "vim.mode == 'Insert' && editorTextFocus"
},
{
"key": "ctrl+e",
"command": "hideSuggestWidget",
"when": "vim.mode == 'Insert' && editorTextFocus"
},
{
"command": "workbench.action.navigateUp",
"key": "ctrl+k"
},
{
"command": "workbench.action.navigateDown",
"key": "ctrl+j"
},
{
"command": "workbench.action.focusActiveEditorGroup",
"key": "ctrl+k",
"when": "terminalFocus"
},
{
"command": "workbench.action.previousEditor",
"key": "ctrl+shift+tab"
},
{
"command": "workbench.action.nextEditor",
"key": "ctrl+tab"
},
{
"command": "editor.action.moveLinesUpAction",
"key": "alt+k",
"when": "editorTextFocus && !editorReadonly"
},
{
"command": "editor.action.moveLinesDownAction",
"key": "alt+j",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+h",
"command": "workbench.action.togglePanel"
},
{
"key": "space b",
"command": "workbench.action.files.newUntitledFile",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"command": "welcome.showNewFileEntries",
"key": "alt+b"
},
{
"key": "space g s",
"command": "workbench.view.scm",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space /",
"command": "editor.action.commentLine",
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual' || vim.mode == 'VisualLine') && editorTextFocus"
},
{
"key": "alt+c",
"command": "vim.remap",
"args": {
"after": [
"\"",
"+"
]
},
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual' || vim.mode == 'VisualLine') && editorTextFocus"
},
{
"command": "selectNextCodeAction",
"key": "space c a",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space r a",
"command": "editor.action.rename",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space f m",
"command": "editor.action.formatDocument",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space f f",
"command": "workbench.action.quickOpen",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space space",
"command": "workbench.action.quickOpen",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space l t",
"command": "workbench.actions.view.problems",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space g d",
"command": "editor.action.revealDefinition",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space g r",
"command": "editor.action.goToReferences",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "shift+k",
"command": "editor.action.showHover",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "ctrl+k",
"command": "editor.action.showDefinitionPreviewHover",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space shift+q",
"command": "workbench.action.closeWindow",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"command": "workbench.action.closeActiveEditor",
"key": "space x",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"command": "workbench.action.closeOtherEditors",
"key": "space shift+x",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "] d",
"command": "editor.action.marker.nextInFiles",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "[ d",
"command": "editor.action.marker.prevInFiles",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "] c",
"command": "editor.action.dirtydiff.next",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "[ c",
"command": "editor.action.dirtydiff.prev",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
// File Explorer
{
"key": "r",
"command": "renameFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "c",
"command": "filesExplorer.copy",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "p",
"command": "filesExplorer.paste",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "x",
"command": "filesExplorer.cut",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "d",
"command": "deleteFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
// Suggestions
{
"command": "selectNextSuggestion",
"key": "ctrl+n",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"command": "selectPrevSuggestion",
"key": "ctrl+p",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+n",
"command": "workbench.action.toggleSidebarVisibility",
"when": "!suggestWidgetVisible"
},
{
"command": "workbench.action.toggleAuxiliaryBar",
"key": "ctrl+alt+n"
},
{
"key": "h",
"command": "editor.action.scrollLeftHover",
"when": "editorHoverFocused"
},
{
"command": "editor.action.scrollDownHover",
"key": "j",
"when": "editorHoverFocused"
},
{
"command": "editor.action.scrollUpHover",
"key": "k",
"when": "editorHoverFocused"
},
{
"command": "editor.action.scrollRightHover",
"key": "l",
"when": "editorHoverFocused"
},
{
"command": "workbench.action.quickOpenSelectNext",
"key": "ctrl+n",
"when": "inQuickOpen"
},
{
"command": "workbench.action.quickOpenSelectPrevious",
"key": "ctrl+p",
"when": "inQuickOpen"
},
{
"command": "workbench.action.quickOpen",
"key": "ctrl+p",
"when": "!suggestWidgetVisible && !terminalFocus && !inQuickOpen"
},
{
"command": "workbench.action.toggleActivityBarVisibility",
"key": "alt+n"
},
{
"command": "-workbench.action.quickOpen",
"key": "ctrl+p"
},
{
"command": "inlineChat.start",
"key": "alt+i",
"when": "editorFocus && inlineChatHasProvider && !editorReadonly"
},
{
"command": "-inlineChat.start",
"key": "ctrl+i",
"when": "editorFocus && inlineChatHasProvider && !editorReadonly"
},
{
"command": "workbench.action.chat.openInEditor",
"key": "shift+alt+i"
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment