Skip to content

Instantly share code, notes, and snippets.

@MasoodGit
Last active January 18, 2025 14:55
Show Gist options
  • Save MasoodGit/1cc302c61622e777ca09f8bf4ae84adc to your computer and use it in GitHub Desktop.
Save MasoodGit/1cc302c61622e777ca09f8bf4ae84adc to your computer and use it in GitHub Desktop.
vscode vim keybindings and settings.json
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+h",
"command": "workbench.action.focusLeftGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusRightGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+k",
"command": "workbench.action.focusAboveGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+j",
"command": "workbench.action.focusBelowGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+t",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+t",
"command": "workbench.action.terminal.focusNext",
"when": "!terminalFocus && editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "space l",
"command": "workbench.action.toggleSidebarVisibility",
"when": "vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+h",
"command": "list.collapse",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+l",
"command": "list.expand",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+k",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+j",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+j",
"command": "selectNextSuggestion",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+k",
"command": "selectPrevSuggestion",
"when": "suggestWidgetVisible"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "ctrl+k",
"command": "workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
]
{
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": [
"--login",
"-i"
],
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.codeLens": true,
"editor.renderWhitespace": "none",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.letterSpacing": 1,
"editor.tabSize": 2,
"editor.wordWrap": "off",
"editor.snippetSuggestions": "top",
"editor.minimap.enabled": false,
"workbench.editor.highlightModifiedTabs": true,
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.js.map": {
"when": "$(basename)"
}
},
"files.hotExit": "onExit",
"files.defaultLanguage": "typescript",
"files.trimTrailingWhitespace": true,
"window.zoomLevel": 1,
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"eslint.alwaysShowStatus": true,
"editor.autoIndent": "full",
"vim.leader": "<Space>",
"vim.normalModeKeyBindingsNonRecursive": [
/* split the editor */
{
"before": [
"<leader>",
"w"
],
"commands": [
"workbench.action.splitEditor"
]
},
{
"before": [
"<leader>",
"f"
],
"commands": [
"revealInExplorer"
],
},
{
"before": [
"<leader>",
"r",
"f"
],
"commands": [
"fileutils.renameFile"
]
},
{
"before": [
"<leader>",
"j"
],
"after": [
"5",
"j"
]
},
{
"before": [
"<leader>",
"k"
],
"after": [
"5",
"k"
]
},
/* move line up */
{
"before": [
"<leader>",
"m"
],
"commands": [
"editor.action.moveLinesUpAction"
]
},
/* move line down */
{
"before": [
"<leader>",
"n"
],
"commands": [
"editor.action.moveLinesDownAction"
]
},
/* join lines */
{
"before": [
"<leader>",
"."
],
"after": [
"J"
]
},
/* comment */
{
"before": [
"<leader>",
"c"
],
"commands": [
"editor.action.commentLine",
],
},
{
"before": [
"<leader>",
"o",
"p"
],
"commands": [
"workbench.action.quickOpen"
]
},
{
"before": [
"<leader>",
"o",
"o"
],
"commands": [
"workbench.action.showEditorsInActiveGroup"
]
},
{
"before": [
"<leader>",
"o",
"g"
],
"commands": [
"workbench.action.showAllSymbols"
]
},
],
"vim.visualModeKeyBindings": [
{
"before": [
"<leader>",
"c"
],
"commands": [
"editor.action.commentLine",
"extension.vim_escape"
],
}
],
"editor.lineNumbers": "relative",
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,
"terminal.integrated.rendererType": "dom",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"workbench.colorTheme": "Oceanic Plus",
"diffEditor.ignoreTrimWhitespace": false,
"vim.commandLineModeKeyBindingsNonRecursive": [],
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment