Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

17.0 KB
Raw Blame
/**
 * Default keymap, matching IntelliJ IDEA's "macOS" keymap. Action ids are the
 * contract between features (which register actions) and keymaps.
 */
export const intellijMacos: Record<string, string[]> = {
  "editor.addOrRemoveCaret": ["Alt+Shift+Button1"],
  // Navigate
  "navigate.searchEverywhere": ["Shift Shift"],
  "navigate.gotoClass": ["Meta+O"],
  "navigate.gotoFile": ["Meta+Shift+O"],
  "navigate.gotoSymbol": ["Meta+Alt+O"],
  "navigate.findAction": ["Meta+Shift+A"],
  "navigate.searchText": ["Meta+Alt+Shift+E"],
  "navigate.navigationBar": ["Meta+Up", "Alt+Home"],
  "navigate.switcher": ["Ctrl+Tab"],
  "navigate.switcherBack": ["Ctrl+Shift+Tab"],
  "navigate.recentFiles": ["Meta+E"],
  "navigate.recentLocations": ["Meta+Shift+E"],
  "navigate.back": ["Meta+[", "Meta+Alt+Left", "Button4", "SwipeRight"],
  "navigate.forward": ["Meta+]", "Meta+Alt+Right", "Button5", "SwipeLeft"],
  "navigate.gotoLine": ["Meta+L"],
  "navigate.declaration": ["Meta+B"],
  "navigate.implementation": ["Meta+Alt+B", "Meta+Alt+Button1"],
  "navigate.typeDeclaration": ["Meta+Shift+B", "Ctrl+Shift+B"],
  "navigate.fileStructure": ["Meta+F12"],
  "navigate.nextError": ["F2"],
  "navigate.prevError": ["Shift+F2"],
  "navigate.callHierarchy": ["Ctrl+Alt+H"],
  "navigate.typeHierarchy": ["Ctrl+H"],
  "navigate.toggleBookmark": ["F3"],
  "navigate.showBookmarks": ["Meta+F3"],
  "navigate.toggleBookmarkWithMnemonic": ["Alt+F3"],
  "navigate.toggleBookmark0": ["Ctrl+Shift+0"],
  "navigate.toggleBookmark1": ["Ctrl+Shift+1"],
  "navigate.toggleBookmark2": ["Ctrl+Shift+2"],
  "navigate.toggleBookmark3": ["Ctrl+Shift+3"],
  "navigate.toggleBookmark4": ["Ctrl+Shift+4"],
  "navigate.toggleBookmark5": ["Ctrl+Shift+5"],
  "navigate.toggleBookmark6": ["Ctrl+Shift+6"],
  "navigate.toggleBookmark7": ["Ctrl+Shift+7"],
  "navigate.toggleBookmark8": ["Ctrl+Shift+8"],
  "navigate.toggleBookmark9": ["Ctrl+Shift+9"],
  "navigate.gotoBookmark0": ["Ctrl+0"],
  "navigate.gotoBookmark1": ["Ctrl+1"],
  "navigate.gotoBookmark2": ["Ctrl+2"],
  "navigate.gotoBookmark3": ["Ctrl+3"],
  "navigate.gotoBookmark4": ["Ctrl+4"],
  "navigate.gotoBookmark5": ["Ctrl+5"],
  "navigate.gotoBookmark6": ["Ctrl+6"],
  "navigate.gotoBookmark7": ["Ctrl+7"],
  "navigate.gotoBookmark8": ["Ctrl+8"],
  "navigate.gotoBookmark9": ["Ctrl+9"],
  "navigate.selectIn": ["Alt+F1"],
  "navigate.showFilePath": ["Meta+Alt+F12"],
  "navigate.lastEditLocation": ["Meta+Shift+Backspace"],
  "navigate.nextEditLocation": [],
  "navigate.gotoTest": ["Meta+Shift+T"],
  "navigate.superMethod": ["Meta+U"],
  "navigate.nextMethod": ["Ctrl+Shift+Down"],
  "navigate.previousMethod": ["Ctrl+Shift+Up"],
  "navigate.nextOccurrence": ["Meta+Alt+Down"],
  "navigate.prevOccurrence": ["Meta+Alt+Up"],

  // Find
  "find.inFile": ["Meta+F"],
  "agents.findInConversation": ["Meta+F"],
  "find.replaceInFile": ["Meta+R"],
  "find.next": ["Meta+G"],
  "find.previous": ["Meta+Shift+G"],
  "find.inPath": ["Meta+Shift+F"],
  "find.replaceInPath": ["Meta+Shift+R"],
  "find.usages": ["Alt+F7"],
  "find.showUsages": ["Meta+Alt+F7"],
  "find.highlightUsages": ["Meta+Shift+F7"],

  // Code
  "code.completion": ["Ctrl+Space"],
  "editor.inlineCompletion.trigger": ["Alt+\\"],
  "editor.inlineCompletion.accept": ["Tab"],
  "editor.inlineCompletion.acceptWord": ["Meta+Right"],
  "editor.inlineCompletion.dismiss": ["Escape"],
  "editor.inlineCompletion.next": ["Alt+]"],
  "editor.inlineCompletion.previous": ["Alt+["],
  "code.parameterInfo": ["Meta+P"],
  "code.quickDocumentation": ["F1", "Ctrl+J"],
  "code.quickDefinition": ["Alt+Space", "Meta+Y"],
  "code.showIntentions": ["Alt+Enter"],
  "code.applyQuickFix": ["Alt+Shift+Enter"],
  "code.reformat": ["Meta+Alt+L"],
  "code.reformatDialog": ["Meta+Alt+Shift+L"],
  "code.optimizeImports": ["Ctrl+Alt+O"],
  "code.commentLine": ["Meta+/"],
  "code.commentBlock": ["Meta+Alt+/", "Ctrl+Shift+/"],
  "code.extendSelection": ["Alt+Up"],
  "code.shrinkSelection": ["Alt+Down"],
  "code.duplicateLine": ["Meta+D"],
  "code.deleteLine": ["Meta+Backspace"],
  "code.moveLineUp": ["Alt+Shift+Up"],
  "code.moveLineDown": ["Alt+Shift+Down"],
  "code.moveStatementUp": ["Meta+Shift+Up"],
  "code.moveStatementDown": ["Meta+Shift+Down"],
  "code.moveElementLeft": ["Meta+Alt+Shift+Left"],
  "code.moveElementRight": ["Meta+Alt+Shift+Right"],
  "code.completeStatement": ["Meta+Shift+Enter"],
  "code.surroundWith": ["Meta+Alt+T"],
  "code.insertLiveTemplate": ["Meta+J"],
  "code.surroundWithLiveTemplate": ["Meta+Alt+J"],
  "code.fold": ["Meta+-"],
  "code.unfold": ["Meta+="],
  "code.foldAll": ["Meta+Shift+-"],
  "code.unfoldAll": ["Meta+Shift+="],
  "code.collapseRecursively": ["Meta+Alt+-"],
  "code.expandRecursively": ["Meta+Alt+="],
  "code.addCaretNextOccurrence": ["Ctrl+G"],
  "code.selectAllOccurrences": ["Ctrl+Meta+G"],
  "code.unselectOccurrence": ["Ctrl+Shift+G"],
  "code.addCaretsToLineEnds": ["Alt+Shift+G"],
  "code.startNewLine": ["Shift+Enter"],
  "code.startNewLineBefore": ["Meta+Alt+Enter"],
  // Before the HTTP / SQL consoles' ⌘↵ (Run), which wins there.
  "code.splitLine": ["Meta+Enter"],
  "editor.scrollToCenter": ["Ctrl+L"],
  "editor.codeBlockStart": ["Meta+Alt+["],
  "editor.codeBlockEnd": ["Meta+Alt+]"],
  "editor.codeBlockStartWithSelection": ["Meta+Alt+Shift+["],
  "editor.codeBlockEndWithSelection": ["Meta+Alt+Shift+]"],
  "editor.contextInfo": ["Ctrl+Shift+Q"],
  "navigate.customRegion": ["Meta+Alt+."],
  "code.expandToLevel1": ["Meta+* 1"],
  "code.expandToLevel2": ["Meta+* 2"],
  "code.expandToLevel3": ["Meta+* 3"],
  "code.expandToLevel4": ["Meta+* 4"],
  "code.expandToLevel5": ["Meta+* 5"],
  "code.expandAllToLevel1": ["Meta+Shift+* 1"],
  "code.expandAllToLevel2": ["Meta+Shift+* 2"],
  "code.expandAllToLevel3": ["Meta+Shift+* 3"],
  "code.expandAllToLevel4": ["Meta+Shift+* 4"],
  "code.expandAllToLevel5": ["Meta+Shift+* 5"],
  "code.collapseBlock": ["Meta+Shift+."],
  "code.autoIndentLines": ["Ctrl+Alt+I"],
  "analyze.inspectFile": ["Alt+Shift+I"],
  "code.showErrorDescription": ["Meta+F1"],
  "navigate.nextHighlightedUsage": ["Ctrl+Alt+Down"],
  "navigate.prevHighlightedUsage": ["Ctrl+Alt+Up"],
  // ⌥ pressed twice and held, then ↑ / ↓.
  "editor.cloneCaretAbove": ["Alt Alt+Up"],
  "editor.cloneCaretBelow": ["Alt Alt+Down"],
  "editor.matchBrace": ["Ctrl+M"],
  "editor.toggleInsertState": ["Insert"],
  "code.joinLines": ["Ctrl+Shift+J"],
  "code.toggleCase": ["Meta+Shift+U"],
  "code.pasteFromHistory": ["Meta+Shift+V"],
  "code.sortLines": [],
  "code.reverseLines": [],
  "code.unwrap": ["Meta+Shift+Delete"],
  "code.foldSelection": ["Meta+."],
  "editor.toggleColumnSelection": ["Meta+Shift+8"],

  // Refactor
  "refactor.thisMenu": ["Ctrl+T"],
  "refactor.rename": ["Shift+F6"],
  "refactor.changeSignature": ["Meta+F6"],
  "refactor.extractVariable": ["Meta+Alt+V"],
  "refactor.extractMethod": ["Meta+Alt+M"],
  "refactor.extractConstant": ["Meta+Alt+C"],
  "refactor.extractField": ["Meta+Alt+F"],
  "refactor.extractParameter": ["Meta+Alt+P"],
  // Git.CreateNewBranch shares Inline's key in IDEA. Listed first, so Inline wins in a text
  // editor; New Branch runs where Inline is disabled (tool windows) and in the Branches popup.
  "vcs.newBranch": ["Meta+Alt+N"],
  "refactor.inline": ["Meta+Alt+N"],
  "refactor.move": ["F6"],
  "refactor.safeDelete": ["Meta+Delete"],
  "refactor.pullMembersUp": [],
  "refactor.pushMembersDown": [],

  // File / editor tabs
  "file.save": ["Meta+S"],
  "file.settings": ["Meta+,"],
  "file.projectStructure": ["Meta+;"],
  "file.openProject": ["Meta+Shift+Alt+O"],
  "file.newScratchFile": ["Meta+Shift+N"],
  "editor.closeTab": ["Meta+W"],
  "toolwindow.closeContent": ["Meta+W", "Ctrl+Shift+F4"],
  "editor.reopenClosedTab": [],
  "file.toggleReadOnly": [],
  "editor.nextTab": ["Ctrl+Right", "Meta+Shift+]"],
  "editor.prevTab": ["Ctrl+Left", "Meta+Shift+["],
  "editor.splitRight": ["Meta+\\"],
  "editor.nextSplitter": ["Alt+Tab"],
  "editor.prevSplitter": ["Alt+Shift+Tab"],
  "window.toggleFullScreen": ["Meta+Ctrl+F"],
  "window.nextTab": ["Meta+Alt+PageDown"],
  "window.previousTab": ["Meta+Alt+PageUp"],
  "window.next": ["Meta+Alt+`"],
  "window.previous": ["Meta+Alt+Shift+`"],
  "file.reloadFromDisk": ["Meta+Alt+Y"],
  // Before the project view's ⇧⌘C (Copy Absolute Path), which wins there.
  "editor.copyPath": [],
  "editor.copyPathReference": ["Meta+Shift+C"],

  // Project view (when: projectViewFocus)
  "project.newFile": ["Meta+N"],
  "project.newInThisDirectory": ["Ctrl+Alt+N"],
  "project.rename": ["Shift+F6"],
  "project.move": ["F6"],
  "project.delete": ["Delete", "Backspace", "Meta+Backspace"],
  "project.copyElement": ["F5"],
  "project.copy": ["Meta+C"],
  "project.cut": ["Meta+X"],
  "project.paste": ["Meta+V"],
  "project.copyAbsolutePath": ["Meta+Shift+C"],
  "project.open": ["F4", "Meta+Down"],
  "project.findUsages": ["Alt+F7"],
  "project.reformatCode": ["Meta+Alt+L"],
  "project.optimizeImports": ["Ctrl+Alt+O"],
  // After Fold / Unfold and File › Reload from Disk: keyWhen limits these to the project view.
  "project.reloadFromDisk": ["Meta+Alt+Y"],
  "project.expandAll": ["Meta+="],
  "project.collapseAll": ["Meta+-"],

  // Tool windows
  "toolwindow.project": ["Meta+1"],
  "toolwindow.bookmarks": ["Meta+2"],
  "toolwindow.find": ["Meta+3"],
  "toolwindow.run": ["Meta+4"],
  "toolwindow.debug": ["Meta+5"],
  "toolwindow.problems": ["Meta+6"],
  "toolwindow.structure": ["Meta+7"],
  "toolwindow.services": ["Meta+8"],
  "toolwindow.git": ["Meta+9"],
  "toolwindow.commit": ["Meta+0"],
  "toolwindow.terminal": ["Alt+F12"],
  "toolwindow.hideAll": ["Meta+Shift+F12"],
  "toolwindow.maximize": ["Meta+Shift+'"],
  "toolwindow.resizeLeft": ["Ctrl+Alt+Left"],
  "toolwindow.resizeRight": ["Ctrl+Alt+Right"],
  "toolwindow.resizeUp": ["Ctrl+Alt+Up"],
  "toolwindow.resizeDown": ["Ctrl+Alt+Down"],
  "layout.restoreDefault": ["Shift+F12"],
  "toolwindow.jumpToLast": ["F12"],
  "toolwindow.hideActive": ["Shift+Escape"],
  "toolwindow.focusEditor": ["Escape"],
  // View › Appearance › Enter / Exit Distraction Free Mode: unbound, as in IDEA
  // (ToggleDistractionFreeMode has no default). ⌃⌘D is macOS's system-wide
  // "Look Up in Dictionary" hotkey, which never reaches the webview.
  "editor.toggleZen": [],

  // Build
  "build.buildProject": ["Meta+F9"],
  "build.buildModule": ["Meta+Shift+F9"],
  "build.rebuildProject": [],
  "build.buildArtifacts": [],

  // Run / debug
  "run.run": ["Ctrl+R"],
  "run.debug": ["Ctrl+D"],
  "run.runContext": ["Ctrl+Shift+R"],
  // In HTML editors (keyWhen) Run opens the browser; listed later, so it wins over run.runContext.
  "web.openInBrowser": ["Ctrl+Shift+R"],
  "run.debugContext": ["Ctrl+Shift+D"],
  "run.stop": ["Meta+F2"],
  "workbench.stopBackgroundProcesses": ["Meta+Shift+F2"],
  "run.updateApplication": ["Meta+F10"],
  // Rerun in the Run / Debug tool window only (when / keyWhen); Meta+R stays with the editor elsewhere.
  "run.rerun": ["Meta+R"],
  "coverage.manageReports": ["Meta+Alt+F6"],
  "debug.rerun": ["Meta+R"],
  // Rerun in the Find / Find Usages tool windows only (when).
  "find.rerun": ["Meta+R"],
  "usages.rerun": ["Meta+R"],
  "run.chooseConfig": ["Ctrl+Alt+R"],
  "run.chooseDebugConfig": ["Ctrl+Alt+D"],
  "run.editConfigs": ["Ctrl+Alt+Shift+R"],
  "debug.toggleBreakpoint": ["Meta+F8"],
  "debug.viewBreakpoints": ["Meta+Shift+F8"],
  "debug.resume": ["Meta+Alt+R", "F9"],
  "debug.stepOver": ["F8"],
  "debug.stepInto": ["F7"],
  "debug.stepOut": ["Shift+F8"],
  "debug.runToCursor": ["Alt+F9"],
  "debug.forceRunToCursor": ["Meta+Alt+F9"],
  "debug.forceStepOver": ["Alt+Shift+F8"],
  "debug.forceStepInto": ["Alt+Shift+F7"],
  "debug.smartStepInto": ["Shift+F7"],
  "debug.showExecutionPoint": ["Alt+F10"],
  "debug.toggleTemporaryBreakpoint": ["Meta+Alt+Shift+F8"],
  "debug.attachToProcess": ["Alt+Shift+F5"],
  "debug.setValue": ["F2"],
  "debug.jumpToSource": ["F4", "Meta+Down"],
  "debug.evaluate": ["Alt+F8"],
  "debug.quickEvaluate": ["Meta+Alt+F8", "Alt+Button1"],
  "debug.browseConsoleHistory": ["Meta+Alt+E"],

  // VCS
  "vcs.operations": ["Ctrl+V"],
  "vcs.commit": ["Meta+K"],
  "vcs.push": ["Meta+Shift+K"],
  "vcs.commitAndPush": ["Meta+Alt+K"],
  "vcs.toggleAmend": ["Ctrl+Alt+M"],
  "vcs.showMessageHistory": ["Ctrl+M"],
  "vcs.update": ["Meta+T"],
  "vcs.rollback": ["Meta+Alt+Z"],
  "vcs.addToVcs": ["Meta+Alt+A"],
  "vcs.showDiff": ["Meta+D"],
  "vcs.nextChange": ["Ctrl+Alt+Shift+Down"],
  "vcs.prevChange": ["Ctrl+Alt+Shift+Up"],
  "vcs.branches": [],
  "vcs.annotate": [],
  "vcs.localHistory": [],
  "localHistory.recentChanges": ["Alt+Shift+C"],
  // Run Anything (⌃⌃) and View › Quick Switch Scheme… (⌃`)
  "runAnything.show": ["Ctrl Ctrl"],
  "view.quickSwitchScheme": ["Ctrl+`"],
  // Commit tool window (change lists) and Git log; keyWhen limits them to those tool windows.
  "vcs.changelist.move": ["Meta+Shift+M"],
  "vcs.changelist.edit": ["F2", "Shift+F6"],
  "vcs.log.copyRevision": ["Meta+Alt+Shift+C"],
  "vcs.log.goToRef": ["Meta+F"],
  // View › Appearance › Zoom IDE
  "view.zoomIn": ["Ctrl+Alt+="],
  "view.zoomOut": ["Ctrl+Alt+-"],
  "view.resetZoom": ["Ctrl+Alt+0"],
  "editor.increaseFontSize": ["Alt+Shift+."],
  "editor.decreaseFontSize": ["Alt+Shift+,"],
  // Diff viewer (after Debug: F7 / ⇧F7 / F4 / ⌘↓ there win while a diff is focused)
  "diff.nextDifference": ["F7"],
  "diff.prevDifference": ["Shift+F7"],
  "diff.jumpToSource": ["F4", "Meta+Down"],
  "diff.applyLeftSide": ["Ctrl+Meta+Right"],
  "diff.applyRightSide": ["Ctrl+Meta+Left"],
  "diff.nextFile": ["Ctrl+Shift+Right"],
  "diff.prevFile": ["Ctrl+Shift+Left"],
  "diff.showSettings": ["Meta+Shift+D"],
  // After Show Diff: ⌘D is Compare With… in the project view.
  "project.compareWith": ["Meta+D"],
  // Editing extras, image viewer (keyWhen: image focused) and Markdown editor layouts
  "code.cyclicExpandWord": ["Alt+/"],
  "code.cyclicExpandWordBackward": ["Alt+Shift+/"],
  "editor.copyReference": ["Meta+Alt+Shift+C"],
  "code.pasteAsPlainText": ["Meta+Alt+Shift+V"],
  "code.expressionTypeInfo": ["Ctrl+Shift+P"],
  "code.implementMethods": ["Ctrl+I"],
  "code.overrideMethods": ["Ctrl+O"],
  "image.zoomIn": ["Meta+="],
  "image.zoomOut": ["Meta+-"],
  "image.actualSize": ["Meta+/"],
  "image.fitToWindow": [],
  "image.toggleChessboard": [],
  "markdown.editorOnly": [],
  "markdown.editorAndPreview": [],
  "markdown.previewOnly": [],
  // HTTP Client / Database console: run the request or statement at the caret.
  "http.runRequest": ["Meta+Enter"],
  "graphql.runQuery": ["Meta+Enter"],
  "http.runAll": [],
  "db.toggleBooleanCell": ["Space"],
  "db.setCellNull": ["Meta+Backspace"],
  "db.setCellDefault": ["Meta+Shift+Backspace"],
  "db.reformatValue": ["Meta+Alt+L"],
  "db.openValueWindow": [],
  "db.findInValue": ["Meta+F"],
  "db.execute": ["Meta+Enter"],
  // Table editor with pending changes (after `vcs.rollback`, so ⌥⌘Z reverts the table's edits there).
  "db.goToColumn": ["Meta+F12"],
  "db.submitChanges": ["Meta+Enter"],
  "db.revertChanges": ["Meta+Alt+Z"],
  "db.showToolWindow": [],
  "agents.newTask": ["Meta+Shift+I"],
  "agents.showToolWindow": [],
  "agents.sendToAgent": [],
  // Database tool window (when the tree has focus; `db.openConsole` anywhere).
  "db.openConsole": ["Meta+Shift+L"],
  "db.newDataSource": [],
  "db.new": ["Meta+N"],
  "services.addService": ["Meta+N"],
  // Pull Requests tool window (Create in its title bar, Refresh per tab) and the review's viewed toggle.
  "github.createPullRequest": ["Meta+N"],
  "github.refresh": ["Meta+R"],
  "github.pullRequest.refresh": ["Meta+R"],
  "github.pullRequest.timeline.refresh": ["Meta+R"],
  "github.pullRequest.toggleViewed": ["Meta+Shift+S"],
  "db.properties": ["Shift+Enter"],
  "db.refresh": ["Meta+R"],
  "db.disconnect": ["Meta+F2"],
  "db.jumpToConsole": ["Meta+Shift+F10"],
  "db.editData": ["F4"],
  "db.goToDdl": ["Meta+B"],
  "db.quickDoc": ["F1"],
  "db.rename": ["Shift+F6"],
  "db.drop": ["Delete", "Meta+Backspace"],
  "db.truncate": [],
  "db.modifyTable": ["Meta+F6"],
  "db.newTable": [],
  "db.newColumn": [],
  "db.copyReference": ["Meta+Alt+Shift+C"],
  "db.duplicateSource": ["Meta+D"],
  "db.ddlToClipboard": ["Meta+Alt+Shift+G"],
  "db.ddlToConsole": ["Meta+Alt+Shift+B"],
  "db.runSqlScript": [],
  "db.sqlScript": [],
  "db.goToReferencedTable": [],
  "db.collapseAll": [],
  // Terminal (keyWhen: terminalFocus); after VCS Update / Go to Test so it wins there.
  "terminal.new": ["Meta+T"],
  // Last: later bindings win, so ⌘N is Generate in editors with Generate actions (keyWhen)
  // and New elsewhere (the project view, other editors: the New popup for the file).
  "code.generate": ["Meta+N"],
  // Find in Files popup (findPopupOpen): after the editor's Find Next, Jump to Source and
  // selection keys, so these win while the popup is open.
  "find.popup.nextResult": ["Meta+G"],
  "find.popup.previousResult": ["Meta+Shift+G"],
  "find.popup.openResult": ["F4", "Meta+Down"],
  "find.popup.recentSearches": ["Alt+Down"],
  // Search fields (find bar, Find in Files): last, so they win over editor keys while one is focused.
  "find.openInWindow": ["Alt+F7"],
  "find.field.newLine": ["Meta+Shift+Enter"],
  "find.field.recentSearches": ["Alt+Down"],
  "editor.pasteHistory.paste": ["Enter"],
  "editor.pasteHistory.remove": ["Delete", "Backspace"],
};