Skip to content

Instantly share code, notes, and snippets.

@MarkyJD
Created July 14, 2023 23:51
Show Gist options
  • Select an option

  • Save MarkyJD/bac226cb0d25beaccd56ef7957149572 to your computer and use it in GitHub Desktop.

Select an option

Save MarkyJD/bac226cb0d25beaccd56ef7957149572 to your computer and use it in GitHub Desktop.
My VS Code keybindings and User settings setup, using VIM and Which-Key extension
// Place your key bindings in this file to override the defaults
[
{
"key": "shift+;",
"command": "vim.showQuickpickCmdLine",
"when": "editorTextFocus && vim.mode != 'Insert'"
},
// Navigation
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight"
},
{
"key": "ctrl+k",
"command": "workbench.action.navigateUp"
},
{
"key": "ctrl+j",
"command": "workbench.action.navigateDown"
},
{
"key": "ctrl+alt+v",
"command": "toggleVim"
},
{
"key": "alt+j",
"command": "editor.action.moveLinesDownAction"
},
{
"key": "alt+k",
"command": "editor.action.moveLinesUpAction"
},
{
"key": "ctrl+alt+j",
"command": "editor.action.insertCursorBelow"
},
{
"key": "ctrl+alt+k",
"command": "editor.action.insertCursorAbove"
},
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
// Explorer and open editor view controls
{
"key": "ctrl+k",
"command": "workbench.files.action.focusOpenEditorsView",
"when": "filesExplorerFocus && !editorFocus"
},
{
"key": "ctrl+j",
"command": "workbench.files.action.focusFilesExplorer",
"when": "workbench.explorer.openEditorsView.active && !editorFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "enter",
"command": "-renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "j",
"command": "list.focusDown",
"when": "listFocus && explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "k",
"command": "list.focusUp",
"when": "listFocus && explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "enter",
"command": "list.select",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "l",
"command": "list.select",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
{
"key": "o",
"command": "list.toggleExpand",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
{
"key": "h",
"command": "list.collapse",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "d",
"command": "deleteFile",
"when": "filesExplorerFocus && !inputFocus"
}
]
{
// Fix esc to caps remap issue on ubuntu
"keyboard.dispatch": "keyCode",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags": true,
"java.configuration.checkProjectSettingsExclusions": false,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [80],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
},
"dart.previewFlutterUiGuides": true,
"workbench.iconTheme": "material-icon-theme",
"liveServer.settings.CustomBrowser": "firefox",
"python.languageServer": "Default",
"workbench.colorTheme": "SynthWave '84",
"workbench.colorCustomizations": {},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.autofetch": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.tabSize": 2,
"diffEditor.wordWrap": "on",
"tabnine.experimentalAutoImports": true,
"bracket-pair-colorizer-2.depreciation-notice": false,
"prettier.singleQuote": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"terminal.integrated.enableMultiLinePasteWarning": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.wordWrap": "on",
"reactSnippets.settings.importReactOnTop": false,
"sync.gist": "c0f47b18939a80be31ec520f44c2d3ab",
"zenMode.hideLineNumbers": false,
// "zenMode.centerLayout": false,
// Vim Settings =========================================
// which key plugin
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<C-space>"],
"commands": ["whichkey.show"]
},
{
"before": ["<leader>", "z"],
"commands": ["workbench.action.toggleZenMode"]
},
{
"before": ["<leader>", "d"],
"after": ["d", "d"]
},
{
"before": ["<leader>", "j"],
"commands": ["editor.action.triggerSuggest"]
},
{
"before": ["<leader>", "n"],
"commands": [":nohl"]
},
{
"before": ["<tab>"],
"commands": ["workbench.action.nextEditor"]
},
// Navigation between panes
{
"before": ["<C-j>"],
"commands": ["workbench.action.navigateDown"]
},
{
"before": ["<C-k>"],
"commands": ["workbench.action.navigateUp"]
},
{
"before": ["<C-h>"],
"commands": ["workbench.action.navigateLeft"]
},
{
"before": ["<C-l>"],
"commands": ["workbench.action.navigateRight"]
},
{
"before": ["K"],
"commands": ["editor.action.showHover"]
},
{
"before": ["<S-tab>"],
"commands": ["workbench.action.previousEditor"]
},
{
"before": ["<leader>", "f"],
"commands": ["revealInExplorer"]
},
{
"before": ["<leader>", "e"],
"commands": ["workbench.action.toggleSidebarVisibility"]
},
{
"before": ["<leader>", "w"],
"commands": ["workbench.action.splitEditor"]
},
{
"before": ["<leader>", "q"],
"commands": ["workbench.action.closeActiveEditor"]
},
{
"before": ["<leader>", "h"],
"after": ["_"]
},
{
"before": ["<leader>", "l"],
"after": ["$"]
},
// Yank and paste to and from system clipboard
{
"before": ["<leader>", "y"],
"after": ["\"", "*", "y"]
},
{
"before": ["<leader>", "p"],
"after": ["\"", "*", "p"]
}
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": ["<C-space>"],
"commands": ["whichkey.show"]
}
],
"vim.visualModeKeyBindings": [
{
"before": [">"],
"after": [">", "g", "v"]
},
{
"before": ["<"],
"after": ["<", "g", "v"]
},
// Yank and paste to and from system clipboard
{
"before": ["<leader>", "y"],
"after": ["\"", "*", "y"]
},
{
"before": ["<leader>", "p"],
"after": ["\"", "*", "p"]
},
{
"before": ["<leader>", "j"],
"commands": ["editor.action.triggerSuggest"]
}
],
"vim.easymotion": true,
"vim.surround": true,
"vim.sneakReplacesF": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
}
],
"vim.leader": "<space>",
"vim.handleKeys": {
"<C-a>": false,
"<C-f>": false
},
// Which key customization
"whichkey.sortOrder": "alphabetically",
"whichkey.bindings": [
{
"key": ";",
"name": "commands",
"type": "command",
"command": "workbench.action.showCommands"
},
{
"key": "b",
"name": "Buffers/Editors...",
"type": "bindings",
"bindings": [
{
"key": "b",
"name": "Show all buffers/editors",
"type": "command",
"command": "workbench.action.showAllEditors"
},
{
"key": "d",
"name": "Close active editor",
"type": "command",
"command": "workbench.action.closeActiveEditor"
},
{
"key": "h",
"name": "Move editor into left group",
"type": "command",
"command": "workbench.action.moveEditorToLeftGroup"
},
{
"key": "j",
"name": "Move editor into below group",
"type": "command",
"command": "workbench.action.moveEditorToBelowGroup"
},
{
"key": "k",
"name": "Move editor into above group",
"type": "command",
"command": "workbench.action.moveEditorToAboveGroup"
},
{
"key": "l",
"name": "Move editor into right group",
"type": "command",
"command": "workbench.action.moveEditorToRightGroup"
},
{
"key": "m",
"name": "Close other editors",
"type": "command",
"command": "workbench.action.closeOtherEditors"
},
{
"key": "n",
"name": "Next editor",
"type": "command",
"command": "workbench.action.nextEditor"
},
{
"key": "p",
"name": "Previous editor",
"type": "command",
"command": "workbench.action.previousEditor"
},
{
"key": "N",
"name": "New untitled editor",
"type": "command",
"command": "workbench.action.files.newUntitledFile"
},
{
"key": "u",
"name": "Reopen closed editor",
"type": "command",
"command": "workbench.action.reopenClosedEditor"
},
{
"key": "y",
"name": "Copy buffer to clipboard",
"type": "commands",
"commands": [
"editor.action.selectAll",
"editor.action.clipboardCopyAction",
"cancelSelection"
]
}
]
},
{
"key": "d",
"name": "Debug...",
"type": "bindings",
"bindings": [
{
"key": "d",
"name": "Start debug",
"type": "command",
"command": "workbench.action.debug.start"
},
{
"key": "S",
"name": "Stop debug",
"type": "command",
"command": "workbench.action.debug.stop"
},
{
"key": "c",
"name": "Continue debug",
"type": "command",
"command": "workbench.action.debug.continue"
},
{
"key": "p",
"name": "Pause debug",
"type": "command",
"command": "workbench.action.debug.pause"
},
{
"key": "r",
"name": "Run without debugging",
"type": "command",
"command": "workbench.action.debug.run"
},
{
"key": "R",
"name": "Restart debug",
"type": "command",
"command": "workbench.action.debug.restart"
},
{
"key": "i",
"name": "Step into",
"type": "command",
"command": "workbench.action.debug.stepInto"
},
{
"key": "s",
"name": "Step over",
"type": "command",
"command": "workbench.action.debug.stepOver"
},
{
"key": "o",
"name": "Step out",
"type": "command",
"command": "workbench.action.debug.stepOut"
},
{
"key": "b",
"name": "Toggle breakpoint",
"type": "command",
"command": "editor.debug.action.toggleBreakpoint"
},
{
"key": "B",
"name": "Toggle inline breakpoint",
"type": "command",
"command": "editor.debug.action.toggleInlineBreakpoint"
},
{
"key": "j",
"name": "Jump to cursor",
"type": "command",
"command": "debug.jumpToCursor"
},
{
"key": "v",
"name": "REPL",
"type": "command",
"command": "workbench.debug.action.toggleRepl"
},
{
"key": "w",
"name": "Focus on watch window",
"type": "command",
"command": "workbench.debug.action.focusWatchView"
},
{
"key": "W",
"name": "Add to watch",
"type": "command",
"command": "editor.debug.action.selectionToWatch"
}
]
},
{
"key": "e",
"name": "Toggle Explorer",
"type": "command",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "f",
"name": "Find & Replace...",
"type": "bindings",
"bindings": [
{
"key": "f",
"name": "File",
"type": "command",
"command": "editor.action.startFindReplaceAction"
},
{
"key": "s",
"name": "Symbol",
"type": "command",
"command": "editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
},
{
"key": "p",
"name": "Project",
"type": "command",
"command": "workbench.action.replaceInFiles"
}
]
},
{
"key": "g",
"name": "Git...",
"type": "bindings",
"bindings": [
{
"key": "b",
"name": "Checkout",
"type": "command",
"command": "git.checkout"
},
{
"key": "c",
"name": "Commit",
"type": "command",
"command": "git.commit"
},
{
"key": "d",
"name": "Delete Branch",
"type": "command",
"command": "git.deleteBranch"
},
{
"key": "f",
"name": "Fetch",
"type": "command",
"command": "git.fetch"
},
{
"key": "i",
"name": "Init",
"type": "command",
"command": "git.init"
},
{
"key": "m",
"name": "Merge",
"type": "command",
"command": "git.merge"
},
{
"key": "p",
"name": "Publish",
"type": "command",
"command": "git.publish"
},
{
"key": "s",
"name": "Stash",
"type": "command",
"command": "workbench.view.scm"
},
{
"key": "S",
"name": "Stage",
"type": "command",
"command": "git.stage"
},
{
"key": "U",
"name": "Unstage",
"type": "command",
"command": "git.unstage"
}
]
},
{
"key": "h",
"name": "Split Horizontal",
"type": "command",
"command": "workbench.action.splitEditorDown"
},
{
"key": "i",
"name": "Insert...",
"type": "bindings",
"bindings": [
{
"key": "j",
"name": "Insert line below",
"type": "command",
"command": "editor.action.insertLineAfter"
},
{
"key": "k",
"name": "Insert line above",
"type": "command",
"command": "editor.action.insertLineBefore"
},
{
"key": "s",
"name": "Insert snippet",
"type": "command",
"command": "editor.action.insertSnippet"
}
]
},
{
"key": "m",
"name": "minimap",
"type": "command",
"command": "editor.action.toggleMinimap"
},
{
"key": "s",
"name": "Search...",
"type": "bindings",
"bindings": [
{
"key": "f",
"name": "files",
"type": "command",
"command": "workbench.action.quickOpen"
},
{
"key": "t",
"name": "text",
"type": "command",
"command": "workbench.action.findInFiles"
}
]
},
{
"key": "S",
"name": "Show...",
"type": "bindings",
"bindings": [
{
"key": "e",
"name": "Show explorer",
"type": "command",
"command": "workbench.view.explorer"
},
{
"key": "s",
"name": "Show search",
"type": "command",
"command": "workbench.view.search"
},
{
"key": "g",
"name": "Show source control",
"type": "command",
"command": "workbench.view.scm"
},
{
"key": "t",
"name": "Show test",
"type": "command",
"command": "workbench.view.extension.test"
},
{
"key": "r",
"name": "Show remote explorer",
"type": "command",
"command": "workbench.view.remote"
},
{
"key": "x",
"name": "Show extensions",
"type": "command",
"command": "workbench.view.extensions"
},
{
"key": "p",
"name": "Show problem",
"type": "command",
"command": "workbench.actions.view.problems"
},
{
"key": "o",
"name": "Show output",
"type": "command",
"command": "workbench.action.output.toggleOutput"
},
{
"key": "d",
"name": "Show debug console",
"type": "command",
"command": "workbench.debug.action.toggleRepl"
}
]
},
{
"key": "t",
"name": "Terminal...",
"type": "bindings",
"bindings": [
{
"key": "t",
"name": "Toggle Terminal",
"type": "command",
"command": "workbench.action.togglePanel"
}
]
},
{
"key": "T",
"name": "UI toggles...",
"type": "bindings",
"bindings": [
{
"key": "b",
"name": "Toggle side bar visibility",
"type": "command",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "j",
"name": "Toggle panel visibility",
"type": "command",
"command": "workbench.action.togglePanel"
},
{
"key": "F",
"name": "Toggle full screen",
"type": "command",
"command": "workbench.action.toggleFullScreen"
},
{
"key": "s",
"name": "Select theme",
"type": "command",
"command": "workbench.action.selectTheme"
},
{
"key": "m",
"name": "Toggle maximized panel",
"type": "command",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "t",
"name": "Toggle tool/activity bar visibility",
"type": "command",
"command": "workbench.action.toggleActivityBarVisibility"
},
{
"key": "T",
"name": "Toggle tab visibility",
"type": "command",
"command": "workbench.action.toggleTabsVisibility"
}
]
},
{
"key": "v",
"name": "Split Vertical",
"type": "command",
"command": "workbench.action.splitEditor"
},
{
"key": "w",
"name": "Window...",
"type": "bindings",
"bindings": [
{
"key": "W",
"name": "Focus previous editor group",
"type": "command",
"command": "workbench.action.focusPreviousGroup"
},
{
"key": "h",
"name": "Move editor group left",
"type": "command",
"command": "workbench.action.moveActiveEditorGroupLeft"
},
{
"key": "j",
"name": "Move editor group down",
"type": "command",
"command": "workbench.action.moveActiveEditorGroupDown"
},
{
"key": "k",
"name": "Move editor group up",
"type": "command",
"command": "workbench.action.moveActiveEditorGroupUp"
},
{
"key": "l",
"name": "Move editor group right",
"type": "command",
"command": "workbench.action.moveActiveEditorGroupRight"
},
{
"key": "t",
"name": "Toggle editor group sizes",
"type": "command",
"command": "workbench.action.toggleEditorWidths"
},
{
"key": "m",
"name": "Maximize editor group",
"type": "command",
"command": "workbench.action.minimizeOtherEditors"
},
{
"key": "M",
"name": "Maximize editor group and hide side bar",
"type": "command",
"command": "workbench.action.maximizeEditor"
},
{
"key": "=",
"name": "Reset editor group sizes",
"type": "command",
"command": "workbench.action.evenEditorWidths"
},
{
"key": "z",
"name": "Combine all editors",
"type": "command",
"command": "workbench.action.joinAllGroups"
},
{
"key": "d",
"name": "Close editor group",
"type": "command",
"command": "workbench.action.closeEditorsInGroup"
},
{
"key": "x",
"name": "Close all editor groups",
"type": "command",
"command": "workbench.action.closeAllGroups"
}
]
},
{
"key": "z",
"name": "Toggle zen mode",
"type": "command",
"command": "workbench.action.toggleZenMode"
}
],
"editor.fontFamily": "Fira Code Retina, Consolas, 'Courier New', monospace",
"editor.fontLigatures": true,
"window.zoomLevel": 1,
"editor.fontWeight": "normal",
"editor.minimap.enabled": false,
"terminal.integrated.cursorBlinking": true,
"inlineFold.unfoldOnLineSelect": true,
"editor.stickyScroll.enabled": true,
"vim.smartRelativeLine": true,
"editor.inlineSuggest.enabled": true,
"vim.neovimPath": "C:\\Program Files\\Neovim\\bin\\nvim.exe",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "keyword.other.dotenv",
"settings": {
"foreground": "#FF000000"
}
}
]
},
"markdown-preview-enhanced.previewTheme": "solarized-light.css",
"vim.neovimConfigPath": "C:\\Users\\Mark\\AppData\\Local\\nvim-data\\init.vim",
"editor.accessibilitySupport": "off",
"files.associations": {
".env*": "dotenv"
},
"terminal.integrated.env.windows": {},
"terminal.integrated.env.linux": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment