Skip to content

Instantly share code, notes, and snippets.

@diogotito
Last active April 17, 2024 16:45
Show Gist options
  • Save diogotito/5ebef428af21fe1798c83588136ee7a4 to your computer and use it in GitHub Desktop.
Save diogotito/5ebef428af21fe1798c83588136ee7a4 to your computer and use it in GitHub Desktop.
VSCode keybindings and settings
// Place your key bindings in this file to override the defaultsauto[]
[
// ===== Vim ===== MARK:vim
// ---- <Alt-[eafbhjkl]> to move the cursor in Insert mode like MARK:vim-rsi
{
"key": "Alt+e",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"A"
]
}
},
{
"key": "Alt+a",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"I"
]
}
},
{
"key": "Alt+f",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"w"
]
}
},
{
"key": "Alt+b",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"b"
]
}
},
{
"key": "Alt+h",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"h"
]
}
},
{
"key": "Alt+j",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"j"
]
}
},
{
"key": "Alt+k",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"k"
]
}
},
{
"key": "Alt+l",
"command": "vim.remap",
"when": "inputFocus && vim.mode == 'Insert'",
"args": {
"after": [
"<C-o>",
"l"
]
}
},
// ===== Neovim ===== MARK:Neovim
// ---- Ctrl+V to Visual Block only in Insert Mode
{
"key": "ctrl+v",
"command": "extension.vim_ctrl+v",
"when": "editorTextFocus && vim.active && vim.mode == 'Normal' && vim.use<C-v> && !inDebugRepl"
},
{
"key": "ctrl+k ctrl+v",
"command": "vscode-neovim.toggle"
},
{
"key": "j k",
"command": "vscode-neovim.escape",
"when": "editorTextFocus && neovim.mode == insert"
},
// ===== Git things ===== MARK:Git things
// ---- Stage, unstage, revert range in editor ----
{
"key": "alt+g s",
"command": "git.stageSelectedRanges",
"when": "editorTextFocus"
},
{
"key": "alt+g a",
"command": "git.stageSelectedRanges",
"when": "editorTextFocus"
},
{
"key": "alt+g u",
"command": "git.unstageSelectedRanges",
"when": "editorTextFocus"
},
{
"key": "alt+g r",
"command": "git.revertSelectedRanges",
"when": "editorTextFocus"
},
// ---- Jump between changes/differences ----
{
"key": "alt+g n",
"command": "workbench.action.editor.nextChange",
"when": "editorTextFocus && !textCompareEditorActive"
},
{
"key": "alg+g p",
"command": "workbench.action.editor.previousChange",
"when": "editorTextFocus && !textCompareEditorActive"
},
// ---- in diff editor ----
{
"key": "ctrl+k ctrl+r",
"command": "-git.revertSelectedRanges",
"when": "isInDiffEditor"
},
{
"key": "ctrl+shift+alt+n",
"command": "gitProjectManager.openProjectNewWindow"
},
{
"key": "ctrl+alt+n",
"command": "-gitProjectManager.openProjectNewWindow"
},
// ===== rest... ===== MARK:misc
{
"key": "shift+alt+w",
"command": "editor.emmet.action.wrapWithAbbreviation"
},
{
"key": "ctrl+k ctrl+r",
"command": "-workbench.action.keybindingsReference"
},
{
"key": "ctrl+shift+alt+v",
"command": "toggleVim"
},
{
"key": "ctrl+shift+j",
"command": "editor.action.joinLines",
"when": "editorTextFocus"
},
{
"key": "ctrl+j",
"command": "-editor.action.joinLines",
"when": "editorTextFocus"
},
{
"key": "shift+alt+l",
"command": "workbench.action.focusPanel"
},
{
"key": "shift+alt+j",
"command": "workbench.action.focusPreviousGroup"
},
{
"key": "ctrl+shift+f",
"command": "workbench.action.terminal.focusFind",
"when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+f",
"command": "-workbench.action.terminal.focusFind",
"when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "shift+alt+m",
"command": "workbench.actions.view.problems",
"when": "workbench.panel.markers.view.active"
},
{
"key": "ctrl+shift+m",
"command": "-workbench.actions.view.problems",
"when": "workbench.panel.markers.view.active"
},
{
"key": "ctrl+shift+m",
"command": "editor.action.selectToBracket"
},
{
"key": "ctrl+shift+k",
"command": "workbench.action.terminal.clear",
"when": "terminalFocus"
},
{
"key": "shift+alt+right",
"command": "-cursorWordEndRightSelect",
"when": "editorTextFocus"
},
{
"key": "shift+alt+left",
"command": "-cursorWordStartLeftSelect",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+space",
"command": "-editor.action.smartSelect.grow",
"when": "editorTextFocus"
},
{
"key": "ctrl+j",
"command": "-workbench.action.togglePanel"
},
{
"key": "ctrl+shift+alt+j",
"command": "workbench.action.togglePanel"
},
{
"key": "ctrl+k ctrl+;",
"command": "workbench.action.toggleSplitEditorInGroup",
"when": "activeEditorCanSplitInGroup"
},
{
"key": "alt+n",
"command": "editor.action.wordHighlight.next",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "alt+p",
"command": "editor.action.wordHighlight.prev",
"when": "editorTextFocus && hasWordHighlights"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeActiveEditor"
},
{
"key": "ctrl+w",
"command": "-workbench.action.terminal.killEditor",
"when": "terminalEditorFocus && terminalFocus && terminalHasBeenCreated && resourceScheme == 'vscode-terminal' || terminalEditorFocus && terminalFocus && terminalProcessSupported && resourceScheme == 'vscode-terminal'"
},
{
"key": "ctrl+w",
"command": "extension.vim_ctrl+w",
"when": "(editorTextFocus || listFocus && !inputFocus) && vim.active && vim.use<C-w> && !inDebugRepl"
},
{
"key": "ctrl+w",
"command": "-extension.vim_ctrl+w",
"when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
},
{
"key": "ctrl+alt+win+n",
"command": "-welcome.showNewFileEntries"
},
{
"key": "ctrl+alt+n",
"command": "explorer.newFile"
},
{
"key": "f5",
"command": "-workbench.action.debug.start",
"when": "debuggersAvailable && debugState == 'inactive'"
},
{
"key": "ctrl+alt+c",
"command": "workbench.action.debug.run",
"when": "debuggersAvailable && debugState != 'initializing'"
},
{
"key": "ctrl+alt+d",
"command": "workbench.action.debug.start"
}
]
{
//-----------------------------------------------------------------MARK: vim
"vim.easymotion": true,
"vim.leader": "<space>",
"vim.sneakUseIgnorecaseAndSmartcase": true,
"vim.hlsearch": true,
"vim.neovimUseConfigFile": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": false,
"vim.handleKeys": {
"<C-d>": true,
"<C-s>": false,
"<C-a>": true, // Increment
"<C-x>": true, // Decrement
"<C-w>": true, // Window management is awesome in Vim
"<C-e>": true, // Scroll down
"<C-y>": true, // Scroll up
"<C-v>": true, // I set up Ctrl+V to paste in insert mode
"<C-z>": false, // Let VS Code undo
"<C-r>": true, // Ok you can redo with Ctrl+R also (C-; for @)
},
"vim.insertModeKeyBindingsNonRecursive": [
{
// My life's worst mistake:
"before": [
"j",
"k"
],
"after": [
"<Esc>"
]
},
],
"vim.enableNeovim": true,
"vim.neovimPath": "C:\\Program Files\\Neovim\\bin\\nvim.exe",
"vim.visualstar": true,
"vim.highlightedyank.enable": true,
"vim.mouseSelectionGoesIntoVisualMode": false,
"vim.showMarksInGutter": true,
"vim.replaceWithRegister": true,
"vim.targets.enable": true,
"vim.vimrc.enable": true,
"vim.statusBarColorControl": false,
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [
"<C-n>"
],
"commands": [
":nohl"
]
},
{
"before": [
"K"
],
"commands": [
"editor.action.showHover"
],
"silent": true,
},
{
"before": [
"g",
"K"
],
"commands": [
"editor.action.peekDefinition"
],
"silent": true,
},
{
"before": [
"]",
"e"
],
"commands": [
"editor.action.moveLinesDownAction"
]
},
{
"before": [
"[",
"e"
],
"commands": [
"editor.action.moveLinesUpAction"
]
},
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": [
"]",
"e"
],
"commands": [
"editor.action.moveLinesDownAction"
]
},
{
"before": [
"[",
"e"
],
"commands": [
"editor.action.moveLinesUpAction"
]
}
],
//---------------------------------------------------------------MARK:editor
"editor.suggestSelection": "first",
"editor.linkedEditing": true,
"editor.lineNumbers": "on",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.renderWhitespace": "none",
"editor.inlayHints.enabled": "offUnlessPressed",
"editor.minimap.showSlider": "always",
"editor.tabCompletion": "off",
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
"editor.rulers": [
80
],
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
//---------------------------------------------------------------MARK:window
"window.autoDetectColorScheme": true,
"window.enableMenuBarMnemonics": false,
"window.doubleClickIconToClose": true,
"window.commandCenter": false,
//-------------------------------------------------------------MARK:terminal
"terminal.integrated.gpuAcceleration": "on",
"terminal.integrated.allowChords": false,
"terminal.external.windowsExec": "wt",
"terminal.integrated.fontFamily": "IosevkaTerm NF",
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.quickOpen",
"-workbench.action.quickOpenLeastRecentlyUsedEditor",
"-workbench.action.quickOpenLeastRecentlyUsedEditorInGroup",
"-workbench.action.quickOpenPreviousEditor",
"-workbench.action.quickOpenPreviousRecentlyUsedEditor",
"-workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
"-workbench.action.quickOpenView",
"-editor.action.toggleTabFocusMode",
"-editor.action.toggleTabFocusMode",
"-workbench.action.terminal.focusFind"
],
// "terminal.integrated.fontWeight": "200",
// "terminal.integrated.letterSpacing": 1,
// "terminal.integrated.fontSize": 13,
//-----------------------------------------------------------------MARK:misc
"debug.openDebug": "openOnDebugBreak",
"explorer.confirmDragAndDrop": false,
"extensions.autoUpdate": "onlyEnabledExtensions",
"extensions.experimental.affinity": {
"asvetliakov.vscode-neovim": 1
},
"files.defaultLanguage": "",
"files.associations": {
"*.jk": "javascript",
"*.rbw": "ruby"
},
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.autofetch": true,
"search.searchEditor.singleClickBehaviour": "peekDefinition",
"security.workspace.trust.untrustedFiles": "open",
"workbench.tree.indent": 16,
"workbench.iconTheme": "vs-minimal",
"workbench.editorAssociations": {
"*.bin": "hexEditor.hexedit"
},
//----------------------------------------------------------MARK:[languages]
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.wordWrapColumn": 80,
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"comments": "off",
"strings": "off",
"other": "off"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ruby]": {
"editor.defaultFormatter": "jnbt.vscode-rufo"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[cpp]": {
"editor.wordBasedSuggestions": "off",
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
//-----------------------------------------------------------MARK:extensions
"ahk++.file.executePath": "C:/Program Files/AutoHotkey/UX/AutoHotkeyUX.exe",
"errorLens.enabledDiagnosticLevels": [
"error",
"info"
],
"haskell.manageHLS": "GHCup",
"hexeditor.columnWidth": 16,
"hexeditor.showDecodedText": true,
"hexeditor.defaultEndianness": "little",
"hexeditor.inspectorType": "aside",
"java.debug.settings.showHex": false,
"java.debug.settings.showQualifiedNames": false,
"java.debug.settings.showStaticVariables": false,
"jupyter.askForKernelRestart": false,
"jupyter.interactiveWindowMode": "perFile",
"npm.enableRunFromFolder": true,
"powershell.integratedConsole.focusConsoleOnExecute": true,
"powershell.buttons.showPanelMovementButtons": false,
"powershell.codeFolding.showLastLine": true,
"python.defaultInterpreterPath": "C:\\Python311\\python.exe",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.venvFolders": [
"C:\\git\\aoc21\\leaderboard\\venv\\"
],
"python.formatting.provider": "black",
"remote.SSH.remotePlatform": {
"laptop": "linux"
},
"rufo.exe": "C:\\Ruby31-x64\\bin\\rufo.bat",
"solargraph.formatting": true,
"scm.alwaysShowActions": true,
"scm.alwaysShowRepositories": true,
"scm.diffDecorationsGutterPattern": {
"added": true
},
"scm.experimental.showSyncView": true,
"scm.inputFontFamily": "Iosevka NF",
"scm.providerCountBadge": "auto",
"svg.completion.showAdvanced": true,
"vscode-neovim.neovimExecutablePaths.win32": "C:\\Program Files\\Neovim\\bin\\nvim.exe",
"zenMode.hideLineNumbers": false,
//---------------------------------------------------------MARK:NEW SETTINGS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment