Skip to content

Instantly share code, notes, and snippets.

@samyarkd
Created May 3, 2025 11:48
Show Gist options
  • Save samyarkd/0f9537f6a2d5afa3f8f8eca792c93c69 to your computer and use it in GitHub Desktop.
Save samyarkd/0f9537f6a2d5afa3f8f8eca792c93c69 to your computer and use it in GitHub Desktop.
My Vscode Vim config and keybinding
[
{
"key": "ctrl+j", // you could use "key": "ctrl+`", if you wish
"command": "workbench.action.terminal.toggleTerminal",
},
{
"key": "h",
"command": "editor.action.scrollLeftHover",
"when": "editorHoverFocused"
},
{
"key": "j",
"command": "editor.action.scrollDownHover",
"when": "editorHoverFocused"
},
{
"key": "k",
"command": "editor.action.scrollUpHover",
"when": "editorHoverFocused"
},
{
"key": "l",
"command": "editor.action.scrollRightHover",
"when": "editorHoverFocused"
},
{
"key": "space e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "f",
"command": "explorer.newFolder",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "x",
"command": "filesExplorer.cut",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "y",
"command": "filesExplorer.copy",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "p",
"command": "filesExplorer.paste",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
}
]
{
"vim.useSystemClipboard": true,
"vim.highlightedyank.enable": true,
"vim.highlightedyank.color": "#a9dc7660",
"vim.highlightedyank.duration": 250,
"vim.leader": "<space>",
"vim.visualModeKeyBindings": [
{
"before": [
"<C-space>",
],
"commands": [
"editor.action.smartSelect.expand",
]
},
],
"vim.normalModeKeyBindings": [
{
"before": [
"<leader>",
"a",
"a",
],
"commands": [
"workbench.action.openQuickChat",
]
},
{
"before": [
"<S-l>",
],
"commands": [
"workbench.action.nextEditor",
]
},
{
"before": [
"<S-h>",
],
"commands": [
"workbench.action.previousEditor",
]
},
{
"before": [
"<C-space>",
],
"commands": [
"editor.action.smartSelect.expand",
]
},
{
"before": [
"<leader>",
"c",
"p"
],
"commands": [
"workbench.action.showCommands",
]
},
{
"before": [
"<leader>",
"b",
"d"
],
"commands": [
"workbench.action.closeActiveEditor",
]
},
{
"before": [
"<leader>",
"e"
],
"commands": [
"workbench.view.explorer",
]
},
{
"before": [
"g",
"p",
"d"
],
"commands": [
"editor.action.peekDefinition"
]
},
{
"before": [
"g",
"h"
],
"commands": [
"editor.action.showDefinitionPreviewHover"
]
},
{
"before": [
"g",
"i"
],
"commands": [
"editor.action.goToImplementation"
]
},
{
"before": [
"g",
"p",
"i"
],
"commands": [
"editor.action.peekImplementation"
]
},
{
"before": [
"c",
"a"
],
"commands": [
"editor.action.quickFix"
]
},
{
"before": [
"g",
"r"
],
"commands": [
"editor.action.referenceSearch.trigger"
]
},
{
"before": [
"g",
"t"
],
"commands": [
"editor.action.goToTypeDefinition"
]
},
{
"before": [
"g",
"p",
"t"
],
"commands": [
"editor.action.peekTypeDefinition"
]
},
{
"before": [
"<S-k>"
],
"commands": [
"editor.action.showDefinitionPreviewHover"
]
},
{
"before": [
"<leader>",
"b",
"n"
],
"commands": [
":tabnext",
]
},
{
"before": [
"<leader>",
"b",
"b"
],
"commands": [
":tabprev"
]
},
{
"before": [
"<leader>",
"o",
"l"
],
"commands": [
"editor.action.openLink"
]
},
{
"before": [
"<leader>",
"<leader>",
],
"commands": [
"workbench.action.quickOpen",
]
},
{
"before": [
"<C-j>",
],
"commands": [
"workbench.action."
]
},
{
"before": [
"<C-b>",
],
"commands": [
"workbench.action.toggleSidebarVisibility"
]
},
{
"before": [
"/"
],
"commands": [
"actions.find"
]
},
{
"before": [
"<leader>",
"g",
"g"
],
"commands": [
"workbench.view.scm"
]
}
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment