Skip to content

Instantly share code, notes, and snippets.

@hexnickk
Last active July 13, 2025 11:36
Show Gist options
  • Select an option

  • Save hexnickk/a2d34a4f2c23c0354c962bfd02f2a14c to your computer and use it in GitHub Desktop.

Select an option

Save hexnickk/a2d34a4f2c23c0354c962bfd02f2a14c to your computer and use it in GitHub Desktop.
keybindings.json
[
// --- Window Navigation (Panes/Groups) ---
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft",
},
{
"key": "ctrl+j",
"command": "workbench.action.navigateDown",
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight",
},
{
"key": "ctrl+k",
"command": "workbench.action.navigateUp",
},
{
"key": "ctrl+o",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+i",
"command": "workbench.action.navigateForward"
},
{
"key": "ctrl+shift+h",
"command": "workbench.action.moveEditorToLeftGroup",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
{
"key": "ctrl+shift+j",
"command": "workbench.action.moveEditorToBelowGroup",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
{
"key": "ctrl+shift+l",
"command": "workbench.action.moveEditorToRightGroup",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
{
"key": "ctrl+shift+k",
"command": "workbench.action.moveEditorToAboveGroup",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
// --- Window Management (Panes)
{
"key": "ctrl+shift+\\",
"command": "workbench.action.splitEditor",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
{
"key": "ctrl+-",
"command": "workbench.action.splitEditorOrthogonal",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus"
},
// --- Space Leader: General & Quick Open ---
{
"key": "space .",
"command": "workbench.action.gotoSymbol",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
{
"key": "space shift+.",
"command": "workbench.action.showAllSymbols",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
{
"key": "space shift+/",
"command": "workbench.action.showAllEditors",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
{
"key": "space /",
"command": "workbench.action.quickOpen",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
{
"key": "space space",
"command": "workbench.action.quickTextSearch",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
{
"key": "space ,",
"command": "workbench.action.showCommands",
"when": "(!vim.mode || vim.mode == 'Normal') && (editorTextFocus || !inputFocus)",
},
// --- Editor Tab Navigation ---
{
"key": "tab",
"command": "workbench.action.nextEditorInGroup",
"when": "(!vim.mode || vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus || !inputFocus)",
},
{
"key": "shift+tab",
"command": "workbench.action.previousEditorInGroup",
"when": "(!vim.mode || vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus || !inputFocus)",
},
// --- Editor Actions: Movement & Selection ---
{
"key": "shift+j",
"command": "editor.action.moveLinesDownAction",
"when": "vim.mode != 'Insert' && editorTextFocus", // Kept as is, requires Vim active and not Insert
},
{
"key": "shift+k",
"command": "editor.action.moveLinesUpAction",
"when": "vim.mode != 'Insert' && editorTextFocus", // Kept as is, requires Vim active and not Insert
},
{
"key": "ctrl+n",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "(!vim.mode || vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus || !inputFocus)",
},
// --- Space Leader: Code Actions ---
{
// code hover
"key": "space c h",
"command": "editor.action.showHover",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
{
// code action
"key": "space c a",
"command": "editor.action.codeAction",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
{
// code rename
"key": "space c r",
"command": "editor.action.rename",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
{
// code definition
"key": "space c d",
"command": "editor.action.revealDefinition",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
{
// code definition in right split
"key": "space c shift+d",
"command": "runCommands",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
"args": {
"commands": [
"workbench.action.splitEditorRight",
"editor.action.revealDefinition"
]
}
},
{
// code usages
"key": "space c u",
"command": "editor.action.goToReferences",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
{
"key": "space c /",
"command": "editor.action.commentLine",
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && editorTextFocus"
},
// --- Space Leader: Buffer/Editor Management ---
{
"key": "space b d",
"command": "workbench.action.closeActiveEditor",
"when": "(!vim.mode || vim.mode == 'Normal') && editorTextFocus",
},
// --- File Explorer Specific Bindings ---
{
"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",
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
},
{
"key": "s",
"command": "explorer.openToSide",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
},
{
"key": "shift+s",
"command": "runCommands",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
"comment": "[Explorer] Split down, open file, close others",
"args": {
"commands": [
"workbench.action.splitEditorDown",
"explorer.openAndPassFocus",
"workbench.action.closeOtherEditors"
]
}
},
{
"key": "enter",
"command": "explorer.openAndPassFocus",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsFolder && !inputFocus",
},
{
"key": "enter",
"command": "list.toggleExpand",
"when": "filesExplorerFocus && foldersViewVisible && explorerResourceIsFolder && !inputFocus",
},
{
"key": "/",
"command": "list.find",
"when": "filesExplorerFocus && foldersViewVisible && !inputFocus"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment