Files
.vscode.d/keybindings.json

1030 lines
34 KiB
JSON

[
//
// ===========================================================================
// MARK: Command Palette
// ===========================================================================
//
{ // Show commands.
"key": "ctrl+x m",
"command": "workbench.action.showCommands"
},
{ // Show commands.
"key": "ctrl+x ctrl+m",
"command": "workbench.action.showCommands"
},
{ // Show commands.
"key": "ctrl+x enter",
"command": "workbench.action.showCommands"
},
{ // Show commands.
"key": "alt+x",
"command": "workbench.action.showCommands"
},
//
// ===========================================================================
// MARK: Cursor (Text Editor)
// ===========================================================================
//
{ // Toggle Agent.
"key": "cmd+i",
"command": "composerMode.agent"
},
{ // Toggle Ask.
"key": "cmd+l",
"command": "composerMode.chat"
},
//
// ===========================================================================
// MARK: Claude Code (Terminal)
// ===========================================================================
//
{
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "\\\r\n"
},
"when": "terminalFocus"
},
//
// ===========================================================================
// MARK: Window
// ===========================================================================
//
{ // Reset zoom.
"key": "cmd+0",
"command": "workbench.action.zoomReset"
},
{ // Toggle sidebar visibility.
"key": "ctrl+s",
"command": "workbench.action.toggleSidebarVisibility"
},
//
// ===========================================================================
// MARK: Window Tabs
// ===========================================================================
//
{ // Go to next window tab.
"key": "ctrl+z ctrl+n",
"command": "workbench.action.showNextWindowTab"
},
{ // Go to next window tab.
//
// This is a workaround for ctrl+n not working globally as down arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+n to
// down arrow.
"key": "ctrl+z down",
"command": "workbench.action.showNextWindowTab"
},
{ // Go to next window tab.
"key": "shift+cmd+]",
"command": "workbench.action.showNextWindowTab"
},
{ // Go to previous window tab.
"key": "ctrl+z ctrl+p",
"command": "workbench.action.showPreviousWindowTab"
},
{ // Go to previous window tab.
//
// This is a workaround for ctrl+p not working globally as up arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+p to
// up arrow.
"key": "ctrl+z up",
"command": "workbench.action.showPreviousWindowTab"
},
{ // Go to previous window tab.
"key": "shift+cmd+[",
"command": "workbench.action.showPreviousWindowTab"
},
{ // Create new window tab.
"key": "ctrl+z ctrl+c",
"command": "workbench.action.newWindowTab"
},
{ // Merge all window tabs.
"key": "ctrl+z ctrl+j",
"command": "workbench.action.mergeAllWindowTabs"
},
{ // Move window tab to new window.
"key": "ctrl+z ctrl+t",
"command": "workbench.action.moveWindowTabToNewWindow"
},
{ // Toggle window tabs bar.
"key": "ctrl+z ctrl+z",
"command": "workbench.action.toggleWindowTabsBar"
},
{
"key": "ctrl+z ctrl+k",
"command": "workbench.action.closeWindow"
},
//
// ===========================================================================
// MARK: Save
// ===========================================================================
//
{ // Save file.
"key": "ctrl+x ctrl+s",
"command": "workbench.action.files.save"
},
//
// ===========================================================================
// MARK: File Open
// ===========================================================================
//
{ // Open file via file browser extension.
"key": "ctrl+x ctrl+f",
"command": "file-browser.open",
"when": "editorTextFocus"
},
{ // Open file via file browser extension.
//
// This is a workaround for ctrl+f not working globally as right arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+f to
// right arrow.
"key": "ctrl+x right",
"command": "file-browser.open",
"when": "editorTextFocus"
},
{ // Open quick open.
"key": "ctrl+x ctrl+;",
"command": "workbench.action.quickOpen"
},
//
// ===========================================================================
// MARK: File Rename
// ===========================================================================
//
{ // Rename file via file browser extension.
"key": "ctrl+c r",
"command": "file-browser.rename"
},
//
// ===========================================================================
// MARK: Switch and Close Editor
// ===========================================================================
//
{ // Show all editors by most recently used.
"key": "ctrl+x ctrl+b",
"command": "workbench.action.showAllEditorsByMostRecentlyUsed",
"when": "!terminalFocus"
},
{ // Show all editors by most recently used.
//
// This is a workaround for ctrl+b not working globally as left arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+b to
// left arrow.
"key": "ctrl+x left",
"command": "workbench.action.showAllEditorsByMostRecentlyUsed",
"when": "!terminalFocus"
},
{ // Close active editor.
"key": "ctrl+x ctrl+k",
"command": "workbench.action.closeActiveEditor",
"when": "!terminalFocus"
},
//
// ===========================================================================
// MARK: Fullscreen
// ===========================================================================
//
{ // Toggle fullscreen.
"key": "cmd+enter",
"command": "workbench.action.toggleFullScreen",
"when": "!isIOS"
},
{ // Toggle fullscreen.
"key": "cmd+ctrl+enter",
"command": "workbench.action.toggleFullScreen",
"when": "!isIOS"
},
{ // Disable default toggle fullscreen keybinding.
"key": "ctrl+cmd+f",
"command": "-workbench.action.toggleFullScreen",
"when": "!isIOS"
},
//
// ===========================================================================
// MARK: Editor/View Navigation
// ===========================================================================
//
{ // Go to next editor.
"key": "cmd+]",
"command": "workbench.action.nextEditor",
"when": "!(terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus)"
},
{ // Go to previous editor.
"key": "cmd+[",
"command": "workbench.action.previousEditor",
"when": "!(terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus)"
},
{ // Focus next terminal.
"key": "cmd+]",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{ // Focus previous terminal.
"key": "cmd+[",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{ // Focus previous panel view.
"key": "cmd+ctrl+[",
"command": "workbench.action.previousPanelView",
"when": "panelVisible"
},
{ // Focus next panel view.
"key": "cmd+ctrl+]",
"command": "workbench.action.nextPanelView",
"when": "panelVisible"
},
//
// ===========================================================================
// MARK: Editor/View Layout
// ===========================================================================
//
{ // Even editor widths.
"key": "ctrl+x space",
"command": "workbench.action.evenEditorWidths",
"when": "!terminalFocus"
},
{ // Toggle maximized editor group.
"key": "ctrl+z ctrl+enter",
"command": "workbench.action.toggleMaximizeEditorGroup",
"when": "!panelFocus"
},
{ // Expand editor group.
"key": "ctrl+z enter",
"command": "workbench.action.minimizeOtherEditors",
"when": "!panelFocus"
},
{ // Toggle maximized panel.
//
// Keybindings that work while terminal is focused are limited as we send
// most keybindings to the terminal. Hence the key choice here does not
// conform to the general pattern of <something>+enter to toggle
// maximize/fullscreen style behavior.
"key": "cmd+shift+o",
"command": "workbench.action.toggleMaximizedPanel",
"when": "panelVisible"
},
//
// ===========================================================================
// MARK: Editor/View Navigation
// ===========================================================================
//
{ // Focus next editor group.
"key": "ctrl+x ctrl+o",
"command": "workbench.action.focusNextGroup",
"when": "!terminalFocus"
},
{ // Focus previous editor group.
"key": "ctrl+x ctrl+i",
"command": "workbench.action.focusPreviousGroup",
"when": "!terminalFocus"
},
{ // Focus previous editor group.
//
// This is a workaround for ctrl+i typically being interpreted as tab by
// some Karabiner-Elements configurations.
"key": "ctrl+x tab",
"command": "workbench.action.focusPreviousGroup",
"when": "!terminalFocus"
},
{ // Navigate up.
"key": "alt+i",
"command": "workbench.action.navigateUp",
"when": "!panelFocus"
},
{ // Navigate up.
//
// Workaround for alt+i not working in VSCode. Relies on Karabiner-Elements
// to remap alt+i to cmd+alt+up.
"key": "cmd+alt+up",
"command": "workbench.action.navigateUp",
"when": "!panelFocus"
},
{ // Navigate right.
"key": "alt+l",
"command": "workbench.action.navigateRight"
},
{ // Navigate left.
"key": "alt+j",
"command": "workbench.action.navigateLeft"
},
{ // Navigate down.
"key": "alt+k",
"command": "workbench.action.navigateDown"
},
{ // Navigate up back to editor from terminal.
"key": "alt+i",
"command": "workbench.action.focusActiveEditorGroup",
"when": "panelFocus"
},
{ // Navigate up back to editor from terminal.
//
// Workaround for alt+i not working in VSCode. Relies on Karabiner-Elements
// to remap alt+i to cmd+alt+up.
"key": "cmd+alt+up",
"command": "workbench.action.focusActiveEditorGroup",
"when": "panelFocus"
},
//
// ===========================================================================
// MARK: Searching
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=jakearl.search-editor-apply-changes
//
{ // Apply changes in search editor.
"key": "cmd+s",
"command": "searchEditorApplyChanges.apply",
"when": "inSearchEditor"
},
{ // Apply changes in search editor.
"key": "ctrl+x ctrl+s",
"command": "searchEditorApplyChanges.apply",
"when": "inSearchEditor"
},
//
// ===========================================================================
// MARK: Quick Input
// ===========================================================================
//
// Quick input uses vim keybindings (ctrl+j/ctrl+k) by default. I specifically
// use Emacs keybindings (ctrl+n/ctrl+p for next/previous), so here we disable
// the default vim keybindings. This lets ctrl+k for example kill to end of
// line, which I use frequently.
//
// There's no need to map ctrl+n/ctrl+p to next/previous quick input item
// because we cover that via Karabiner-Elements.
//
{ // Disable default next quick input item keybinding.
"key": "ctrl+j",
"command": "-quickInput.next",
"when": "inQuickInput && quickInputType == 'quickPick'"
},
{ // Disable default previous quick input item keybinding.
"key": "ctrl+k",
"command": "-quickInput.previous",
"when": "inQuickInput && quickInputType == 'quickPick'"
},
// ===========================================================================
// MARK: Move Active Editor Group
// ===========================================================================
//
{ // Move active editor group up.
"key": "ctrl+shift+i",
"command": "workbench.action.moveActiveEditorGroupUp"
},
{ // Move active editor group down.
"key": "ctrl+shift+k",
"command": "workbench.action.moveActiveEditorGroupDown"
},
{ // Move active editor group left.
"key": "ctrl+shift+j",
"command": "workbench.action.moveActiveEditorGroupLeft"
},
{ // Move active editor group right.
"key": "ctrl+shift+l",
"command": "workbench.action.moveActiveEditorGroupRight"
},
//
// ===========================================================================
// MARK: Move Active Editor into Group
// ===========================================================================
//
{ // Move active editor into group above.
"key": "alt+shift+i",
"command": "workbench.action.moveEditorToAboveGroup"
},
{ // Move active editor into group above.
//
// Workaround for alt+i not working in VSCode. Relies on Karabiner-Elements
// to remap alt+i to cmd+alt+up.
"key": "cmd+alt+shift+up",
"command": "workbench.action.moveEditorToAboveGroup"
},
{ // Move active editor into group below.
"key": "alt+shift+k",
"command": "workbench.action.moveEditorToBelowGroup"
},
{ // Move active editor into group left.
"key": "alt+shift+j",
"command": "workbench.action.moveEditorToLeftGroup"
},
{ // Move active editor into group right.
"key": "alt+shift+l",
"command": "workbench.action.moveEditorToRightGroup"
},
//
// ===========================================================================
// MARK: Undo/Redo
// ===========================================================================
//
{ // Undo.
"key": "alt+-",
"command": "undo"
},
{ // Redo.
"key": "alt+shift+-",
"command": "redo"
},
//
// ===========================================================================
// MARK: Scrolling
// ===========================================================================
//
{ // Scroll half page down.
"key": "ctrl+v",
"command": "editorScroll",
"args": {
"to": "down",
"by": "halfPage",
"revealCursor": true,
"value": 1
},
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Scroll half page up.
"key": "alt+v",
"command": "editorScroll",
"args": {
"to": "up",
"by": "halfPage",
"revealCursor": true,
"value": 1
},
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Disable awesome-emacs-keymap scroll down keybinding.
"key": "ctrl+v",
"command": "-emacs-mcx.scrollUpCommand",
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Disable awesome-emacs-keymap scroll up keybinding.
"key": "alt+v",
"command": "-emacs-mcx.scrollDownCommand",
"when": "editorTextFocus && !config.emacs-mcx.useMetaPrefixMacCmd && !suggestWidgetVisible"
},
//
// ===========================================================================
// MARK: Suggestions
// ===========================================================================
//
{ // Trigger suggestions.
"key": "ctrl+/",
"command": "editor.action.triggerSuggest",
"when": "editorTextFocus"
},
{ // Toggle suggestion details.
"key": "ctrl+/",
"command": "toggleSuggestionDetails",
"when": "editorTextFocus && suggestWidgetVisible"
},
{ // Accept next word.
"key": "shift+alt+f",
"command": "editor.action.inlineSuggest.acceptNextWord"
},
{ // Accept next word.
//
// This is a workaround for alt+f not working globally to move to next word
// in all input fields. This relies on Karabiner-Elements to remap alt+f to
// alt+right arrow.
"key": "shift+alt+right",
"command": "editor.action.inlineSuggest.acceptNextWord"
},
//
// ===========================================================================
// MARK: Text Navigation
// ===========================================================================
//
{ // Forward paragraph.
"key": "alt+e",
"command": "emacs-mcx.forwardParagraph",
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Forward paragraph.
//
// This is a workaround for alt+e not working in VSCode. Relies on
// Karabiner-Elements to remap alt+e to cmd+alt+right.
"key": "cmd+alt+right",
"command": "emacs-mcx.forwardParagraph",
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Backward paragraph.
"key": "alt+a",
"command": "emacs-mcx.backwardParagraph",
"when": "editorTextFocus && !suggestWidgetVisible"
},
{ // Go to symbol definition.
"key": "ctrl+t",
"command": "workbench.action.gotoSymbol",
"when": "editorTextFocus"
},
{ // Jump to definition.
"key": "ctrl+c ctrl+j",
"command": "editor.action.revealDefinition"
},
{ // Beginning of buffer.
"key": "cmd+up",
"command": "emacs-mcx.beginningOfBuffer",
"when": "editorFocus"
},
{ // End of buffer.
"key": "cmd+down",
"command": "emacs-mcx.endOfBuffer",
"when": "editorFocus"
},
//
// ===========================================================================
// MARK: Code Navigation
// ===========================================================================
//
{ // Navigate back.
"key": "alt+g b",
"command": "workbench.action.navigateBack"
},
{ // Navigate back.
"key": "alt+g alt+b",
"command": "workbench.action.navigateBack"
},
{ // Peek definition.
"key": "alt+shift+;",
"command": "editor.action.peekDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{ // Peek symbol references.
"key": "alt+shift+/",
"command": "editor.action.referenceSearch.trigger",
"when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{ // Peek symbol implementations.
"key": "alt+shift+\\",
"command": "editor.action.peekImplementation",
"when": "editorHasImplementationProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{ // Peek call hierarchy.
"key": "alt+shift+'",
"command": "editor.showCallHierarchy",
"when": "editorHasCallHierarchyProvider && editorTextFocus && !inReferenceSearchEditor"
},
//
// ===========================================================================
// MARK: Emacs-like behavior
// ===========================================================================
//
// Extensions:
// - https://marketplace.visualstudio.com/items?itemName=tuttieee.emacs-mcx
//
// These keybindings were borrowed from the awesome-emacs-keymap extension and
// modified in the following ways:
//
// - For compatibility with Cursor:
// - Added `!cpp.shouldAcceptTab` and `!cursorAtInlineEdit` conditions to
// not trigger when Cursor is displaying tab-accepted suggestions.
// - Removed `config.emacs-mcx.emacsLikeTab` condition, as enabling it
// breaks accepting suggestions in Cursor with the tab key.
// - For compatibility with text-tables extension:
// - Added `!tableMode` condition.
//
// The original condition from awesome-emacs-keymap was:
//
// "when": "config.emacs-mcx.emacsLikeTab && editorTextFocus && !editorReadonly && !inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible && !inSnippetMode && !editorTabCompletion && !editorParameterHintsVisible"
//
{ // Set indentation to correct level.
"key": "tab",
"command": "emacs-mcx.tabToTabStop",
"when": "editorTextFocus && !editorReadonly && !inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible && !inSnippetMode && !editorTabCompletion && !editorParameterHintsVisible && !cursorAtInlineEdit && !cpp.shouldAcceptTab && !tableMode"
},
{ // Set indentation to correct level.
"key": "ctrl+i",
"command": "emacs-mcx.tabToTabStop",
"when": "editorTextFocus && !editorReadonly && !inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible && !inSnippetMode && !editorTabCompletion && !editorParameterHintsVisible && !cursorAtInlineEdit && !cpp.shouldAcceptTab && !tableMode"
},
//
// ===========================================================================
// MARK: Text Manipulation
// ===========================================================================
//
{ // Cycle spacing.
//
// This is a basic emulation Emacs' built-in cycle-spacing command. It
// doesn't actually cycle spacing, but it performs the first step which is
// to replace all spacing surrounding the cursor with a single space.
"key": "alt+space",
"command": "macros.cycleSpacing",
"when": "editorTextFocus && !editorReadonly"
},
{ // Toggle quotes.
//
// Extension: https://marketplace.visualstudio.com/items?itemName=BriteSnow.vscode-toggle-quotes
"key": "ctrl+'",
"command": "editor.togglequotes",
"when": "editorTextFocus && !editorReadonly"
},
{ // Comment line.
"key": "ctrl+c /",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{ // Comment line.
"key": "ctrl+c ctrl+/",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{ // Format document.
"key": "ctrl+c ctrl+f",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{ // Format document.
//
// This is a workaround for ctrl+f not working globally as right arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+f to
// right arrow.
"key": "ctrl+c right",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{ // Duplicate selection.
"key": "ctrl+x ctrl+d",
"command": "editor.action.duplicateSelection"
},
{ // Duplicate selection.
//
// This is a workaround for ctrl+d not working globally as forward delete in
// all input fields. This relies on Karabiner-Elements to remap ctrl+d to
// forward delete.
"key": "ctrl+x delete",
"command": "editor.action.duplicateSelection"
},
{ // Rename thing at point.
"key": "ctrl+c ctrl+.",
"command": "editor.action.rename",
"when": "editorHasRenameProvider && editorTextFocus && !editorReadonly"
},
{ // Indent line
"key": "ctrl+c ]",
"command": "editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // Indent line
"key": "alt+]",
"command": "editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // Outdent line
"key": "ctrl+c [",
"command": "editor.action.outdentLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // Outdent line
"key": "alt+[",
"command": "editor.action.outdentLines",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move lines up in editor.
"key": "alt+p",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move lines down in editor.
"key": "alt+n",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move lines down in editor.
//
// This is a workaround for alt+n not working in VSCode. Relies on
// Karabiner-Elements to remap alt+n to cmd+alt+down.
"key": "cmd+alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{ // Move cell up in notebook editor.
"key": "alt+p",
"command": "notebook.cell.moveUp",
"when": "notebookEditorFocused && !inputFocus"
},
{ // Move cell down in notebook editor.
"key": "alt+n",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
{ // Move cell down in notebook editor.
//
// This is a workaround for alt+n not working in VSCode. Relies on
// Karabiner-Elements to remap alt+n to cmd+alt+down.
"key": "cmd+alt+down",
"command": "notebook.cell.moveDown",
"when": "notebookEditorFocused && !inputFocus"
},
//
// ===========================================================================
// MARK: Expand Region
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=letrieu.expand-region
//
{ // Expand selection.
"key": "alt+.",
"command": "expand_region",
"when": "editorTextFocus"
},
{ // Shrink/contract selection.
"key": "alt+,",
"command": "undo_expand_region",
"when": "editorHasSelection && editorTextFocus"
},
//
// ===========================================================================
// MARK: Rewrap Revived
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=dnut.rewrap-revived
//
{ // Toggle auto wrap in current document.
"key": "ctrl+c q",
"command": "rewrap.toggleAutoWrap",
"when": "editorTextFocus"
},
//
// ===========================================================================
// MARK: Multi-Cursor
// ===========================================================================
//
{ // Select all highlights.
"key": "shift+cmd+a",
"command": "editor.action.selectHighlights",
"when": "editorFocus"
},
{ // Disable default insert cursor above keybinding.
"key": "alt+cmd+up",
"command": "-editor.action.insertCursorAbove",
"when": "editorTextFocus"
},
{ // Insert cursor above.
"key": "alt+m",
"command": "editor.action.insertCursorAbove",
"when": "editorTextFocus && !editorHasSelection"
},
{ // Add selection to previous find match when editor has selection.
"key": "alt+m",
"command": "emacs-mcx.addSelectionToPreviousFindMatch",
"when": "editorTextFocus && editorHasSelection"
},
{ // Disable default insert cursor below keybinding.
"key": "alt+cmd+down",
"command": "-editor.action.insertCursorBelow",
"when": "editorTextFocus"
},
{ // Insert cursor below when editor has no selection.
"key": "alt+/",
"command": "editor.action.insertCursorBelow",
"when": "editorTextFocus && !editorHasSelection"
},
{ // Add selection to next find match when editor has selection.
"key": "alt+/",
"command": "emacs-mcx.addSelectionToNextFindMatch",
"when": "editorTextFocus && editorHasSelection"
},
//
// ===========================================================================
// MARK: Completion
// ===========================================================================
//
{
"key": "alt+shift+f",
"command": "editor.action.inlineSuggest.acceptNextWord"
},
//
// ===========================================================================
// MARK: Testing
// ===========================================================================
//
{ // Run current file.
"key": "ctrl+c , v",
"command": "macros.runTestCurrentFile",
"when": "editorTextFocus"
},
{ // Run with coverage for current file.
"key": "ctrl+c , ctrl+v",
"command": "macros.runTestCoverageCurrentFile",
"when": "editorTextFocus"
},
{ // Run at cursor.
"key": "ctrl+c , s",
"command": "macros.runTestAtCursor",
"when": "editorTextFocus"
},
{ // Run with coverage at cursor.
"key": "ctrl+c , ctrl+s",
"command": "macros.runTestCoverageAtCursor",
"when": "editorTextFocus"
},
{ // Run all tests.
"key": "ctrl+c , a",
"command": "macros.runTestAll",
"when": "editorTextFocus"
},
{ // Run with coverage for all tests.
"key": "ctrl+c , ctrl+a",
"command": "macros.runTestCoverageAll",
"when": "editorTextFocus"
},
{ // Re-run last run.
"key": "ctrl+c , l",
"command": "macros.runTestReRunLastRun",
"when": "editorTextFocus"
},
{ // Re-run with coverage for last run.
"key": "ctrl+c , ctrl+l",
"command": "macros.runTestCoverageLastRun",
"when": "editorTextFocus"
},
{ // Re-run failed tests.
"key": "ctrl+c , f",
"command": "macros.runTestReRunFailTests",
"when": "editorTextFocus"
},
{ // Debug failed tests.
"key": "ctrl+c , ctrl+f",
"command": "macros.runTestDebugFailTests",
"when": "editorTextFocus"
},
{ // Debug failed tests.
//
// This is a workaround for ctrl+f not working globally as right arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+f to
// right arrow.
"key": "ctrl+c , right",
"command": "macros.runTestDebugFailTests",
"when": "editorTextFocus"
},
{ // Debug last run.
"key": "ctrl+c , d",
"command": "macros.runTestDebugLastRun",
"when": "editorTextFocus"
},
//
// ===========================================================================
// MARK: Documentation
// ===========================================================================
//
{ // Show documentation for symbol at cursor.
"key": "ctrl+c d",
"command": "editor.action.showHover"
},
{ // Show documentation for symbol at cursor.
"key": "ctrl+c ctrl+d",
"command": "editor.action.triggerParameterHints"
},
{ // Show documentation for symbol at cursor.
//
// This is a workaround for ctrl+d not working globally as forward delete in
// all input fields. Hence we rebind ctrl+d to forward delete, meaning any
// keybindings that use ctrl+d need to be updated to use delete as well.
"key": "ctrl+c delete",
"command": "editor.action.triggerParameterHints"
},
//
// ===========================================================================
// MARK: edamagit
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=kahole.magit
//
{ // Open magit status.
"key": "ctrl+x g",
"command": "magit.status"
},
{ // Disable default open magit status keybinding.
"key": "alt+x g",
"command": "-magit.status"
},
//
// ===========================================================================
// MARK: GitHub
// ===========================================================================
// Extensions:
// - https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub
// - https://marketplace.visualstudio.com/items?itemName=github.vscode-github-actions
// - https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
// - https://marketplace.visualstudio.com/items?itemName=ziyasal.vscode-open-in-github
//
{
"key": "ctrl+c g",
"command": "extension.openInGitHub"
},
//
// ===========================================================================
// MARK: Project Manager
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
//
{ // List projects.
"key": "ctrl+z ctrl+s",
"command": "projectManager.listProjects"
},
{ // Disable default list projects keybinding.
"key": "alt+cmd+p",
"command": "-projectManager.listProjects"
},
{
"key": "ctrl+z ctrl+;",
"command": "projectManager.listProjectsNewWindow"
},
//
// ===========================================================================
// MARK: dired
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=rrudi.vscode-dired
//
{ // Open dired.
"key": "ctrl+x ctrl+j",
"command": "extension.dired.open",
"when": "editorTextFocus && !inDebugRepl"
},
{ // Disable default open dired keybinding.
"key": "ctrl+x f",
"command": "-extension.dired.open",
"when": "editorTextFocus && !inDebugRepl"
},
{ // Create directory.
"key": "c",
"command": "extension.dired.createDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen"
},
{ // Disable default create directory keybinding.
"key": "shift+=",
"command": "-extension.dired.createDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen"
},
{ // Go up directory.
"key": "ctrl+l",
"command": "extension.dired.goUpDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen"
},
{ // Disable default go up directory keybinding.
"key": "shift+b",
"command": "-extension.dired.goUpDir",
"when": "dired.open && !findWidgetVisible && !inQuickOpen"
},
//
// ===========================================================================
// MARK: swiper
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=wenhoujx.swiper
//
{ // Swiper word at cursor.
"key": "alt+r",
"command": "swiper.swiper-word-at-cursor"
},
//
// ===========================================================================
// MARK: Text Tables
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=RomanPeshkov.vscode-text-tables
//
{ // Format under cursor.
"key": "ctrl+q ctrl+f",
"command": "text-tables.formatUnderCursor"
},
{ // Format under cursor.
//
// This is a workaround for ctrl+f not working globally as right arrow in
// all input fields. This relies on Karabiner-Elements to remap ctrl+f to
// right arrow.
"key": "ctrl+q right",
"command": "text-tables.formatUnderCursor"
},
//
// ===========================================================================
// MARK: Makefile Task Runner
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=carlos-algms.make-task-provider
//
{ // Run target.
"key": "ctrl+c ctrl+m",
"command": "make-task-provider.runTarget"
},
{ // Run target.
"key": "ctrl+c enter",
"command": "make-task-provider.runTarget"
},
//
// ===========================================================================
// MARK: Lang: Go
// ===========================================================================
//
{
"key": "ctrl+c , t",
"command": "go.toggle.test.file",
"when": "editorTextFocus && editorLangId == 'go'"
}
]