VSCode keybindings.json file

November 23, 2024 note-to-self backup vscode

My keybindings.json file, mostly for backup purposes:

[
    {
        "key": "ctrl+m",
        "command": "bookmarks.toggle",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+0",
        "command": "workbench.action.nextEditor",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+1",
        "command": "coverage-gutters.toggleCoverage"
    },
    {
        "key": "ctrl+2",
        "command": "workbench.action.terminal.toggleTerminal",
        "when": "terminal.active"
    },
    {
        "key": "ctrl+3",
        "command": "phpunit.rerun",
        "when": "editorTextFocus && editorLangId == 'php'"
    },
    {
        "key": "ctrl+4",
        "command": "workbench.action.quickOpen",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+5",
        "command": "workbench.action.showCommands",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+6",
        "command": "workbench.files.action.showActiveFileInExplorer",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+7",
        "command": "relative-path-and-line.copyRelativePathAndLine"
    },
    {
        "key": "ctrl+8",
        "zzzwhen": "editorTextFocus && vim.active && vim.mode != 'Insert'",
        "zzzcommand": "workbench.action.findInFiles",
        "command": "search.action.openNewEditor",
        "args": {
          "query": "${selectedText}",
          "triggerSearch": true,
          "preserveCase": true,
          "isRegex": false,
          "isCaseSensitive": false,
          "matchWholeWord": false,
          "useExcludeSettingsAndIgnoreFiles": false,
          "filesToInclude": "${relativeFile}",
          "filesToExclude": "",
          "contextLines": 0
        }
    },
    {
        "key": "ctrl+9",
        "command": "workbench.action.previousEditor",
        "when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
    },
    {
        "key": "ctrl+k",
        "command": "editor.action.formatSelection",
        "when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
    },
    {
        "key": "shift+cmd+[",
        "command": "-workbench.action.previousEditor"
    },
    {
        "key": "shift+cmd+3",
        "command": "phpunit.TestNearest"
    },
    {
        "key": "ctrl+`",
        "command": "-workbench.action.terminal.toggleTerminal",
        "when": "terminal.active"
    },
    {
        "key": "tab",
        "command": "-editor.emmet.action.expandAbbreviation",
        "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorReadonly && !editorTabMovesFocus"
    },
    {
        "key": "tab",
        "command": "extension.vim_tab",
        "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
    },
    {
        "key": "tab",
        "command": "-extension.vim_tab",
        "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
    },
    {
        "key": "` tab",
        "command": "jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    },
    {
        "key": "tab",
        "command": "-jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    },
    {
        "key": "` tab",
        "command": "insertSnippet",
        "when": "editorTextFocus && hasSnippetCompletions && !editorTabMovesFocus && !inSnippetMode"
    },
    {
        "key": "tab",
        "command": "-insertSnippet",
        "when": "editorTextFocus && hasSnippetCompletions && !editorTabMovesFocus && !inSnippetMode"
    },
    {
        "key": "tab",
        "command": "tab",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "tab",
        "command": "-tab",
        "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
    },
    {
        "key": "ctrl+/",
        "command": "-github.copilot.acceptCursorPanelSolution",
        "when": "github.copilot.activated && github.copilot.panelVisible"
    },
    {
        "key": "alt+]",
        "command": "-github.copilot.nextPanelSolution",
        "when": "github.copilot.activated && github.copilot.panelVisible"
    },
    {
        "key": "alt+[",
        "command": "-github.copilot.previousPanelSolution",
        "when": "github.copilot.activated && github.copilot.panelVisible"
    },
    {
        "key": "ctrl+enter",
        "command": "-github.copilot.generate",
        "when": "editorTextFocus && github.copilot.activated && !inInteractiveInput && !interactiveEditorFocused"
    },
    {
        "key": "cmd+i",
        "command": "-github.copilot.terminal.suggestCommand",
        "when": "terminalFocus"
    },
    {
        "key": "alt+\\",
        "command": "-editor.action.inlineSuggest.trigger",
        "when": "config.github.copilot.inlineSuggest.enable && editorTextFocus && !editorHasSelection && !inlineSuggestionsVisible"
    },
    {
        "key": "shift+f12",
        "command": "editor.action.goToReferences",
        "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
    },
    {
        "key": "shift+f12",
        "command": "-editor.action.goToReferences",
        "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
    },
    {
        "key": "ctrl+f12",
        "command": "editor.gotoNextSymbolFromResult",
        "when": "hasSymbols"
    },
    {
        "key": "ctrl+f12",
        "command": "goToNextReference",
        "when": "inReferenceSearchEditor || referenceSearchVisible"
    },
    {
        "key": "f12",
        "command": "-editor.action.revealDefinition",
        "when": "editorHasDefinitionProvider && editorTextFocus"
    },
    {
        "key": "ctrl+=",
        "command": "workbench.action.navigateForward",
        "when": "canNavigateForward"
    },
    {
        "key": "ctrl+shift+-",
        "command": "-workbench.action.navigateForward",
        "when": "canNavigateForward"
    },
    {
        "key": "ctrl+-",
        "command": "-workbench.action.quickInputBack",
        "when": "inQuickOpen"
    },
    {
        "key": "shift+cmd+5",
        "command": "-coverage-gutters.toggleCoverage"
    },
    {
        "key": "ctrl+8",
        "command": "-workbench.action.openEditorAtIndex8"
    }
]

Note: on a Mac, these are in ~/Library/Application Support/Code/User/keybindings.json