[
    // ----- DISABLED KEYBINDINGS
    {
        "key": "ctrl+j", // disable default
        "command": "-workbench.action.togglePanel"
    },
    {
        "key": "alt+z", // disable default
        "command": "-editor.action.toggleWordWrap"
    },
    {
        "key": "ctrl+shift+tab", // disable default
        "command": "-workbench.action.quickOpenNavigatePreviousInEditorPicker",
        "when": "inEditorsPicker && inQuickOpen"
    },
    {
        "key": "ctrl+tab", // disable default
        "command": "-workbench.action.quickOpenNavigateNextInEditorPicker",
        "when": "inEditorsPicker && inQuickOpen"
    },
    {
        "key": "ctrl+w", // disable default
        "command": "-workbench.action.closeActiveEditor"
    },
    {
        "key": "ctrl+k w",
        "command": "-workbench.action.closeEditorsInGroup"
    },
    {
        "key": "alt+k", // disable default
        "command": "-keybindings.editor.recordSearchKeys",
        "when": "inKeybindings && inKeybindingsSearch"
    },
    {
        "key": "ctrl+e", // disable default
        "command": "-workbench.action.quickOpenNavigateNextInFilePicker",
        "when": "inFilesPicker && inQuickOpen"
    },
    {
        "key": "ctrl+shift+e", // disable default
        "command": "-workbench.action.quickOpenNavigatePreviousInFilePicker",
        "when": "inFilesPicker && inQuickOpen"
    },
    {
        "key": "ctrl+alt+enter", // disable default
        "command": "-editor.action.replaceAll",
        "when": "editorFocus && findWidgetVisible"
    },
    {
        "key": "ctrl+alt+enter", // disable default
        "command": "-search.action.replaceAll",
        "when": "replaceActive && searchViewletVisible && !findWidgetVisible"
    },
    {
        "key": "ctrl+k left", // disable default
        "command": "-workbench.action.moveActiveEditorGroupLeft"
    },
    {
        "key": "ctrl+k right", // disable default
        "command": "-workbench.action.moveActiveEditorGroupRight"
    },
    {
        "key": "ctrl+k up", // disable default
        "command": "-workbench.action.moveActiveEditorGroupUp"
    },
    {
        "key": "ctrl+k down", // disable default
        "command": "-workbench.action.moveActiveEditorGroupDown"
    },
    {
        "key": "ctrl+k ctrl+right", // disable default
        "command": "-workbench.action.focusRightGroup"
    },
    {
        "key": "ctrl+k ctrl+left", // disable default
        "command": "-workbench.action.focusLeftGroup"
    },
    {
        "key": "ctrl+k ctrl+up", // disable default
        "command": "-workbench.action.focusAboveGroup"
    },
    {
        "key": "ctrl+k ctrl+down", // disable default
        "command": "-workbench.action.focusBelowGroup"
    },
    {
        "key": "ctrl+w", // disable default
        "command": "-workbench.action.closeWindow",
        "when": "!editorIsOpen && !multipleEditorGroups"
    },
    {
        "key": "ctrl+w", // disable default
        "command": "-workbench.action.closeGroup",
        "when": "activeEditorGroupEmpty && multipleEditorGroups"
    },
    {
        "key": "ctrl+shift+w", // disable default
        "command": "-workbench.action.closeWindow"
    },
    {
        "key": "ctrl+k ctrl+a", // disable default
        "command": "-keybindings.editor.addKeybinding",
        "when": "inKeybindings && keybindingFocus"
    },
    {
        "key": "ctrl+k ctrl+e",
        "command": "-keybindings.editor.defineWhenExpression",
        "when": "inKeybindings && keybindingFocus"
    },
    {
        "key": "ctrl+n",
        "command": "-workbench.action.files.newUntitledFile"
    },
    {
        "key": "ctrl+p",
        "command": "-workbench.action.quickOpen"
    },
    {
        "key": "ctrl+space",
        "command": "-editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    },
    {
        "key": "enter",
        "command": "-acceptSelectedSuggestion",
        "when": "acceptSuggestionOnEnter && suggestWidgetVisible && suggestionMakesTextEdit && textInputFocus"
    },
    {
        "key": "ctrl+space",
        "command": "-toggleSuggestionDetails",
        "when": "suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "ctrl+u",
        "command": "-cursorUndo",
        "when": "textInputFocus"
    },
    {
        "key": "tab",
        "command": "-insertSnippet",
        "when": "editorTextFocus && hasSnippetCompletions && !editorTabMovesFocus && !inSnippetMode"
    },
    {
        "key": "tab",
        "command": "-jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    },
    {
        "key": "shift+tab",
        "command": "-jumpToPrevSnippetPlaceholder",
        "when": "editorTextFocus && hasPrevTabstop && inSnippetMode"
    },
    {
        "key": "escape",
        "command": "-leaveSnippet",
        "when": "editorTextFocus && inSnippetMode"
    },
    {
        "key": "up",
        "command": "-selectPrevSuggestion",
        "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "down",
        "command": "-selectNextSuggestion",
        "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "tab",
        "command": "-insertBestCompletion",
        "when": "atEndOfWord && textInputFocus && !hasOtherSuggestions && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
    },

    // ----- MY KEYBINDINGS
    {
        "key": "ctrl+alt+[Backquote]", // C-M-²
        "command": "workbench.action.togglePanel"
    },
    {
        "key": "alt+z",
        "command": "workbench.action.nextEditor"
    },
    {
        "key": "alt+a",
        "command": "workbench.action.previousEditor"
    },
    {
        "key": "alt+d",
        "command": "workbench.action.closeActiveEditor"
    },
    {
        "key": "alt+d",
        "command": "workbench.action.closeGroup",
        "when": "activeEditorGroupEmpty && multipleEditorGroups"
    },
    {
        "key": "ctrl+space alt+d",
        "command": "workbench.action.closeEditorsInGroup"
    },
    {
        "key": "ctrl+space ctrl+d",
        "command": "workbench.action.closeEditorsInGroup"
    },
    {
        "key": "shift+alt+a",
        "command": "workbench.action.moveEditorLeftInGroup"
    },
    {
        "key": "shift+alt+z",
        "command": "workbench.action.moveEditorRightInGroup"
    },
    {
        "key": "alt+n",
        "command": "editor.action.nextMatchFindAction",
        "when": "editorFocus"
    },
    {
        "key": "shift+alt+n",
        "command": "editor.action.previousMatchFindAction",
        "when": "editorFocus"
    },
    {
        "key": "alt+v",
        "command": "editor.action.clipboardPasteAction"
    },
    {
        "key": "ctrl+alt+f",
        "command": "editor.action.formatDocument",
        "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
    },
    {
        "key": "alt+[Backquote]", // M-²
        "command": "workbench.action.terminal.toggleTerminal"
    },
    {
        "key": "alt+f",
        "command": "workbench.action.quickOpen"
    },
    {
        "key": "alt+j",
        "command": "list.focusDown",
        // DOES NOT WORK EVERYWHERE :/ (like in the command palette)
        // "when": "listFocus"
        "when": "listFocus && !inputFocus"
    },
    {
        "key": "alt+k",
        "command": "list.focusUp",
        "when": "listFocus && !inputFocus"
    },
    {
        "key": "alt+j",
        "command": "workbench.action.quickOpenSelectNext",
        "when": "inFilesPicker && inQuickOpen"
    },
    {
        "key": "alt+k",
        "command": "workbench.action.quickOpenSelectPrevious",
        "when": "inFilesPicker && inQuickOpen"
    },
    {
        "key": "alt+s",
        "command": "workbench.action.files.save"
    },
    {
        "key": "ctrl+space ctrl+enter",
        "command": "workbench.action.tasks.runTask"
    },
    {
        "key": "alt+g",
        "command": "cursorTop",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+g",
        "command": "cursorBottom",
        "when": "textInputFocus"
    },
    {
        "key": "alt+w",
        "command": "cursorWordStartRight",
        "when": "textInputFocus"
    },
    {
        "key": "alt+b",
        "command": "cursorWordLeft",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+b",
        "command": "cursorWordLeftSelect",
        "when": "textInputFocus"
    },
    {
        "key": "alt+e",
        "command": "cursorWordEndRight",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+e",
        "command": "cursorWordEndRightSelect",
        "when": "textInputFocus"
    },
    {
        "key": "ctrl+u",
        "command": "deleteAllLeft",
        "when": "textInputFocus"
    },
    {
        "key": "ctrl+alt+u",
        "command": "deleteAllRight",
        "when": "textInputFocus"
    },
    {
        "key": "alt+[BracketRight]", // M-$
        "command": "cursorEnd",
        "when": "textInputFocus"
    },
    {
        "key": "alt+[BracketLeft]", // M-^
        "command": "cursorHome",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+[BracketRight]", // M-S-$
        "command": "cursorEndSelect",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+[BracketLeft]", // M-S-^
        "command": "cursorHomeSelect",
        "when": "textInputFocus"
    },
    {
        "key": "alt+h",
        "command": "cursorLeft",
        "when": "textInputFocus"
    },
    {
        "key": "alt+j",
        "command": "cursorDown",
        "when": "textInputFocus"
    },
    {
        "key": "alt+k",
        "command": "cursorUp",
        "when": "textInputFocus"
    },
    {
        "key": "alt+l",
        "command": "cursorRight",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+h",
        "command": "cursorLeftSelect",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+j",
        "command": "cursorDownSelect",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+k",
        "command": "cursorUpSelect",
        "when": "textInputFocus"
    },
    {
        "key": "shift+alt+l",
        "command": "cursorRightSelect",
        "when": "textInputFocus"
    },
    {
        "key": "ctrl+h",
        "command": "workbench.action.focusLeftGroup"
    },
    {
        "key": "ctrl+l",
        "command": "workbench.action.focusRightGroup"
    },
    {
        "key": "ctrl+k",
        "command": "workbench.action.focusAboveGroup"
    },
    {
        "key": "ctrl+j",
        "command": "workbench.action.focusBelowGroup"
    },
    {
        // Used to move focus to the editor when the terminal has focus.
        // NOTES:
        // - Ctrl-k isn't usable in the terminal anymore,
        //   but I don't need it in shell, and in nvim I can `<C-w>k`
        // - focus change isn't visually clear/distinct
        //   Waiting for: https://github.com/bew/dotfiles/issues/69
        "key": "ctrl+k",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+space shift+k",
        "command": "workbench.action.moveEditorToAboveGroup"
    },
    {
        "key": "ctrl+space shift+j",
        "command": "workbench.action.moveEditorToBelowGroup"
    },
    {
        "key": "ctrl+space shift+h",
        "command": "workbench.action.moveEditorToLeftGroup"
    },
    {
        "key": "ctrl+space shift+l",
        "command": "workbench.action.moveEditorToRightGroup"
    },
    {
        "key": "alt+n",
        "command": "keybindings.editor.addKeybinding",
        "when": "inKeybindings && keybindingFocus"
    },
    {
        "key": "alt+backspace",
        "command": "keybindings.editor.resetKeybinding"
    },
    {
        "key": "ctrl+space ctrl+b",
        "command": "workbench.action.openGlobalKeybindings"
    },
    {
        "key": "ctrl+space ctrl+n",
        "command": "workbench.action.files.newUntitledFile"
    },
    {
        "key": "ctrl+space z",
        "command": "workbench.action.toggleZenMode"
    },
    {
        "key": "ctrl+space s",
        "command": "workbench.action.splitEditorDown"
    },
    {
        "key": "ctrl+space v",
        "command": "workbench.action.splitEditorRight"
    },
    {
        "key": "alt+w",
        "command": "keybindings.editor.defineWhenExpression",
        "when": "inKeybindings && keybindingFocus"
    },
    {
        "key": "alt+c",
        "command": "editor.action.clipboardCopyAction",
        "when": "editorTextFocus && selectionAnchorSet"
    },
    {
        "key": "ctrl+alt+enter",
        "command": "python.execInTerminal",
        "when": "editorLangId == 'python'"
    },
    {
        "key": "ctrl+n",
        "command": "editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+n",
        "command": "selectNextSuggestion",
        "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "ctrl+p",
        "command": "selectPrevSuggestion",
        "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "ctrl+y",
        "command": "acceptSelectedSuggestion",
        "when": "acceptSuggestionOnEnter && suggestWidgetVisible && suggestionMakesTextEdit && textInputFocus"
    },
    {
        "key": "alt+space",
        "command": "toggleSuggestionDetails",
        "when": "suggestWidgetVisible && textInputFocus"
    },
    {
        "key": "alt+o",
        "command": "editor.action.insertLineAfter",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "shift+alt+o",
        "command": "editor.action.insertLineBefore",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "alt+u",
        "command": "undo"
    },
    {
        "key": "shift+alt+u",
        "command": "redo"
    },
    {
        "key": "ctrl+space ctrl+alt+s",
        "command": "workbench.action.openSettings"
    },
    {
        "key": "[Backquote]",
        "command": "insertSnippet",
        "when": "editorTextFocus && hasSnippetCompletions && !editorTabMovesFocus && !inSnippetMode"
    },
    {
        "key": "alt+j",
        "command": "jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    },
    {
        "key": "alt+k",
        "command": "jumpToPrevSnippetPlaceholder",
        "when": "editorTextFocus && hasPrevTabstop && inSnippetMode"
    },
    {
        "key": "alt+escape",
        "command": "leaveSnippet",
        "when": "editorTextFocus && inSnippetMode"
    },
    {
        "key": "tab",
        "command": "insertBestCompletion",
        // The changs with the base 'tab' binding, is that it's _always_ the same behavior,
        // even when inside a snippet (instead of jumping to next placeholder)
        "when": "atEndOfWord && textInputFocus && !hasOtherSuggestions && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
    }
]
