Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created January 26, 2025 09:10
Show Gist options
  • Save jondkinney/341bc49a84fadde9f8e525497c831f49 to your computer and use it in GitHub Desktop.
Save jondkinney/341bc49a84fadde9f8e525497c831f49 to your computer and use it in GitHub Desktop.
Vim-like VSCode Settings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+l",
"command": "workbench.action.focusFirstEditorGroup",
"when": "sideBarFocus"
},
{
"key": "ctrl+h",
"command": "workbench.action.focusActiveEditorGroup",
"when": "inChatInput"
},
{
"key": "ctrl+k",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "escape",
"command": "cancelSelection",
"when": "listFindInputFocused"
},
{
"key": "escape",
"command": "workbench.files.action.focusFilesExplorer",
"when": "(searchViewletVisible && searchViewletFocus)"
},
{
"key": "ctrl+shift+r",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "npx playwright test ${file}\u000D"
},
"when": "editorTextFocus"
},
{
"key": "ctrl+t",
"command": "workbench.action.terminal.toggleTerminal"
// "command": "smartSplit.toggleTerminalAndSidebar"
},
{
"key": "alt+j",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
{
"key": "alt+k",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "/",
"command": "list.find",
"when": "explorerViewletFocus && !inputFocus"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+d",
"command": "workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inQuickOpen"
},
{
"key": "ctrl+u",
"command": "workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inQuickOpen"
},
{
"key": "ctrl+t",
"command": "-smartSplit.toggleTerminalAndSidebar"
}
]
{
"editor.minimap.enabled": false,
"keyboard.dispatch": "keyCode",
"editor.tabSize": 2,
"editor.cursorBlinking": "solid",
"editor.accessibilitySupport": "off",
"editor.formatOnSave": true,
"chat.editing.alwaysSaveWithGeneratedChanges": true,
"vim.cursorStylePerMode.normal": "block",
"vim.hlsearch": true,
"vim.leader": ",",
"vim.useSystemClipboard": true,
"vim.visualstar": true,
"vim.useCtrlKeys": true,
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": [
"<leader>",
"/"
],
"commands": [
"editor.action.commentLine"
]
},
{
"before": [
"v"
],
"commands": [
"editor.action.smartSelect.grow"
],
},
],
"vim.insertModeKeyBindings": [
{
"before": [
"S",
"S"
],
"commands": [
"workbench.action.files.save"
],
"after": [
"<Esc>"
]
}
],
"vim.normalModeKeyBindings": [
{
"before": [
"S",
"S"
],
"commands": [
"workbench.action.files.save"
]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [
"j"
],
"after": [
"g",
"j"
]
},
{
"before": [
"k"
],
"after": [
"g",
"k"
]
},
{
"before": [
"<leader>",
" "
],
"commands": [
":noh"
]
},
{
"before": [
"*"
],
"after": [
"*",
"N"
]
},
{
"before": [
"<leader>",
"/"
],
"commands": [
"editor.action.commentLine"
]
},
{
"before": [
"<space>", // regular vim setup uses h but only in column 0
],
"commands": [
"editor.toggleFold"
]
},
{
"before": [
"l"
],
"commands": [
{
"command": "editor.unfold",
"when": "editorFocus && foldingEnabled"
},
"cursorRight"
]
},
{
"before": [
"g",
"l"
],
"commands": [
"editor.action.showHover"
]
},
{
"before": [
"v",
"v"
],
"after": [
"v",
"i",
"w"
]
},
{
"before": [
"Q",
"Q"
],
"commands": [
":q"
]
},
{
"before": [
"|"
],
"commands": [
"workbench.action.splitEditorRight"
]
},
{
"before": [
"-"
],
"commands": [
"workbench.action.splitEditorDown"
]
},
{
"before": [
"<C-h>"
],
"commands": [
"smartSplit.navigateLeft"
]
},
{
"before": [
"<C-l>"
],
"commands": [
"smartSplit.navigateRight"
]
},
{
"before": [
"<C-k>"
],
"commands": [
"workbench.action.navigateUp"
]
},
{
"before": [
"<C-j>"
],
"commands": [
"workbench.action.navigateDown"
]
},
{
"before": [
"<leader>",
"g",
"g"
],
"commands": [
"smartSplit.launchLazygit"
]
},
{
"before": [
"<leader>",
"g",
"g"
],
"commands": [
{
"command": "workbench.action.closeSidebar"
},
{
"command": "workbench.action.toggleMaximizedPanel"
},
{
"command": "terminal.focus"
},
{
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "lazygit && exit\u000D"
}
}
]
},
{
"before": [
"<leader>",
"t"
],
"commands": [
"workbench.action.terminal.focus",
{
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "npx playwright test --grep \"$(sed -n '/test(/,/}/p ${file} | grep -oP '(?<=test\\(\").*?(?=\")')\"\u000D"
}
}
]
},
{
"before": [
"<leader>",
"e"
],
"commands": [
"workbench.action.toggleSidebarVisibility"
]
},
{
"before": [
"<leader>",
"D"
],
"commands": [
"workbench.files.action.showActiveFileInExplorer"
]
},
{
"before": [
"("
],
"commands": [
"workbench.action.previousEditor"
]
},
{
"before": [
")"
],
"commands": [
"workbench.action.nextEditor"
]
},
{
"before": [
"<leader>",
"f",
"f"
],
"commands": [
"workbench.action.quickOpen"
]
},
{
"before": [
"<leader>",
"f",
"g"
],
"commands": [
"workbench.action.findInFiles"
]
},
{
"before": [
"<leader>",
"f",
"o"
],
"commands": [
"workbench.action.showAllEditorsByMostRecentlyUsed"
]
},
{
"before": [
"<leader>",
"f",
"c"
],
"commands": [
{
"command": "editor.action.addSelectionToNextFindMatch",
"args": {}
},
{
"command": "workbench.action.findInFiles",
"args": {
"query": "${selectedText}",
"triggerSearch": true,
"matchWholeWord": true
}
},
"search.action.focusSearchList"
]
},
],
"terminal.integrated.defaultLocation": "editor",
"terminal.integrated.allowChords": false,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.fontSize": 13,
"terminal.integrated.lineHeight": 1.2,
"terminal.integrated.gpuAcceleration": "on",
// "terminal.integrated.fontFamily": "Hack Nerd Font Mono",
"terminal.integrated.fontFamily": "CaskaydiaCove Nerd Font",
// "terminal.integrated.fontFamily": "JetBrains Mono",
"workbench.colorTheme": "Nord",
"editor.scrollBeyondLastLine": false,
"editor.smoothScrolling": true,
"editor.cursorSurroundingLines": 0,
"editor.scrollbar.vertical": "hidden",
"workbench.list.smoothScrolling": true,
"workbench.quickOpen.preserveInput": true,
"window.dialogStyle": "custom",
"window.density.editorTabHeight": "compact",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment