// Zed keymap — AstroNvim-style bindings // // For information on binding keys, see the Zed // documentation: https://zed.dev/docs/key-bindings // // To see the default key bindings run `zed: open default keymap` // from the command palette. [ // ── Autocomplete / Code Actions menu ── { "context": "Editor && (showing_code_actions || showing_completions)", "bindings": { "up": "editor::ContextMenuPrevious", "down": "editor::ContextMenuNext", "tab": "editor::ContextMenuNext", "shift-tab": "editor::ContextMenuPrevious" } }, { "context": "Editor && showing_completions", "bindings": { "enter": "editor::ConfirmCompletion" } }, // ── Normal mode (leader = space) ── { "context": "Editor && vim_mode == normal", "bindings": { // Tab switching "ctrl-j": "pane::ActivateNextItem", "ctrl-k": "pane::ActivatePrevItem", // Buffer / Close (AstroNvim: c, C) "space c": "pane::CloseActiveItem", "shift-space c": "pane::CloseActiveItem", // Save (AstroNvim: w) "space w": "workspace::Save", // New file (AstroNvim: n) "space n": "workspace::NewFile", // Quit window (AstroNvim: q) "space q": "pane::CloseActiveItem", // ── Find / Search (AstroNvim: f*) ── "space f f": "file_finder::Toggle", "space f w": "pane::DeploySearch", "space f b": "tab_switcher::Toggle", "space f o": "file_finder::Toggle", "space f h": "zed::OpenKeymap", "space f t": "theme_selector::Toggle", "space f c": "editor::FindAllReferences", "space f k": "zed::OpenKeymap", // ── LSP (AstroNvim: l*) ── "space l f": "editor::Format", "space l a": "editor::ToggleCodeActions", "space l r": "editor::Rename", "space l d": "editor::Hover", "space l s": "outline::Toggle", "space l S": "project_symbols::Toggle", "space l R": "editor::FindAllReferences", "space l D": "diagnostics::Deploy", // Go-to LSP (AstroNvim: gd, gy, gK) "g d": "editor::GoToDefinition", "g y": "editor::GoToTypeDefinition", "g r": "editor::FindAllReferences", "g i": "editor::GoToImplementation", "shift-k": "editor::Hover", // "g shift-k": signature help — no equivalent in Zed // ── Git (AstroNvim: g*) ── "space g b": "editor::ToggleGitBlame", "space g d": "editor::ToggleHunkDiff", // "space g t": git status — no equivalent in Zed "space g l": "editor::ToggleGitBlameInline", // Git hunk navigation (AstroNvim: ]g / [g) "] g": "editor::GoToHunk", "[ g": "editor::GoToPrevHunk", // ── Diagnostics navigation (AstroNvim: ]d / [d, ]e / [e) ── "] d": "editor::GoToDiagnostic", "[ d": "editor::GoToPrevDiagnostic", "] e": "editor::GoToDiagnostic", "[ e": "editor::GoToPrevDiagnostic", // Hover diagnostics (AstroNvim: gl, ld) "g l": "editor::Hover", // ── Buffers (AstroNvim: b*, ]b, [b) ── "space b b": "tab_switcher::Toggle", "space b c": "pane::CloseInactiveItems", "space b C": "pane::CloseAllItems", "space b d": "pane::CloseActiveItem", "] b": "pane::ActivateNextItem", "[ b": "pane::ActivatePrevItem", // ── Splits (AstroNvim: | and \) ── "|": "pane::SplitRight", "\\": "pane::SplitDown", // ── Comment (AstroNvim: /) ── "space /": "editor::ToggleComments", // ── Explorer (AstroNvim: e, o) ── "space e": "workspace::ToggleLeftDock", "space o": "workspace::ToggleLeftDock", // ── Symbols outline (AstroNvim: lS) ── // ── Toggle UI (AstroNvim: u*) ── "space u w": "editor::ToggleSoftWrap", "space u d": "diagnostics::Deploy", "space u z": "workspace::ToggleCenteredLayout", // ── Debug (AstroNvim: d*) ── "space d b": "editor::ToggleBreakpoint", "space d c": "debugger::Continue", "space d i": "debugger::StepInto", "space d o": "debugger::StepOver", "space d shift-o": "debugger::StepOut", // "space d q": stop debug — no confirmed action name in Zed "space d r": "debugger::Start", // ── Terminal (AstroNvim: tf, th, tv) ── "space t f": "terminal_panel::ToggleFocus", // ── Search / Replace ── "space s": "pane::DeploySearch", // ── Quickfix / Location List (AstroNvim: xq, xl) ── "space x q": "diagnostics::Deploy", // 0 → ^ removed: conflicts with count motions like 20j // "0": "vim::FirstNonWhitespace" } }, // ── Visual mode ── { "context": "Editor && vim_mode == visual", "bindings": { // Comment toggle (AstroNvim: / → gc) "space /": "editor::ToggleComments", // Indent / Unindent (AstroNvim: / ) "tab": "editor::Indent", "shift-tab": "editor::Outdent", // 0 → ^ removed: conflicts with count motions like 20j // "0": "vim::FirstNonWhitespace" } }, // ── Workspace-level bindings ── { "context": "Workspace", "bindings": { "space e": "workspace::ToggleLeftDock", // Tab switching // (moved to Editor && vim_mode == normal for higher priority) // Force write (AstroNvim: ) "ctrl-s": "workspace::Save", // Force quit (AstroNvim: ) "ctrl-q": "zed::Quit", // Toggle terminal (AstroNvim: ) "ctrl-`": "terminal_panel::ToggleFocus" } }, // ── Terminal panel ── { "context": "Terminal", "bindings": { // Back to editor from terminal (AstroNvim: ) "ctrl-`": "workspace::ToggleBottomDock" } } ]