-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprivate_keymap.json
More file actions
380 lines (349 loc) · 18.8 KB
/
private_keymap.json
File metadata and controls
380 lines (349 loc) · 18.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
[
// ═══════════════════════════════════════════════════════════════════════════════
// GLOBAL: UI Font Scaling (without persist)
// ═══════════════════════════════════════════════════════════════════════════════
{
"use_key_equivalents": true,
"bindings": {
"cmd-+": ["zed::IncreaseUiFontSize", { "persist": false }],
"cmd-_": ["zed::DecreaseUiFontSize", { "persist": false }],
"cmd-)": ["zed::ResetUiFontSize", { "persist": false }],
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// WORKSPACE: Zoom toggle
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Workspace",
"bindings": {
"ctrl-z": "workspace::ToggleZoom",
"ctrl-shift-tab": "pane::ActivatePreviousItem",
"ctrl-tab": "pane::ActivateNextItem",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// PANE NAVIGATION & SPLITTING
// Works across: Editor, Terminal, Panels, etc.
// - ctrl-h/j/k/l: move between panes (vim-style)
// - ctrl-arrows: resize panes
// - alt-left/right: switch tabs
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Dock || Terminal || Editor || ProjectPanel || AssistantPanel || CollabPanel || OutlinePanel || ChatPanel || VimControl || EmptyPane || SharedScreen || MarkdownPreview || KeyContextView || Diagnostics",
"bindings": {
"cmd-d": "pane::SplitRight",
// Navigate between panes (vim-style)
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
// Resize panes
"ctrl-right": "vim::ResizePaneRight",
"ctrl-left": "vim::ResizePaneLeft",
"ctrl-down": "vim::ResizePaneDown",
"ctrl-up": "vim::ResizePaneUp",
// Tab navigation
"alt-right": "pane::ActivateNextItem",
"alt-left": "pane::ActivatePreviousItem",
"alt-,": "pane::SwapItemLeft",
"alt-.": "pane::SwapItemRight",
"alt-p": "pane::TogglePinTab",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// GIT PANEL
// - q: close panel
// - ctrl-j/k: navigate between changes list and commit editor
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "GitPanel",
"bindings": {
"q": "git_panel::Close",
"cmd-shift-g": "git_panel::ToggleFocus",
},
},
{
"context": "GitPanel && ChangesList",
"use_key_equivalents": true,
"bindings": {
"ctrl-j": "git_panel::FocusEditor",
},
},
{
"context": "GitPanel && CommitEditor > Editor",
"use_key_equivalents": true,
"bindings": {
"ctrl-k": "git_panel::FocusChanges",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM LEADER BINDINGS: Global (ProjectPanel, EmptyPane, Editor)
// These work in normal/visual mode across multiple contexts
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "ProjectPanel || EmptyPane || (Editor && VimControl && !VimWaiting && !menu)",
"bindings": {
"cmd-shift-s": "workspace::SaveWithoutFormat",
// Buffers & Tabs
"space ,": "tab_switcher::OpenInActivePane",
// Git
"space G": "git_panel::ToggleFocus",
"cmd-shift-g": "git_panel::ToggleFocus",
"space g g": ["task::Spawn", { "task_name": "lazygit" }],
// File explorer & tools
"space y": ["task::Spawn", { "task_name": "yazi" }],
"space e": "workspace::ToggleLeftDock",
// Search & Diagnostics
"space s d": "diagnostics::Deploy",
"space s g": "pane::DeploySearch",
// Projects
"space f p": "projects::OpenRecent",
// Notifications
"space u n": "workspace::ClearAllNotifications",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM EDITOR: Leader bindings (normal & visual mode)
// Organized by prefix:
// space a: agent/AI
// space b: buffers
// space c: code actions
// space g: git
// space h: marks
// space m: markdown
// space s: search
// space t: tasks
// space u: UI toggles
// space x: extras
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
// === Agent/AI ===
"space a t": "agent::AddSelectionToThread",
// === Buffers ===
"space b W": "pane::CloseCleanItems",
"space b w": "pane::CloseOtherItems",
// === Code ===
"space c a": "editor::ToggleCodeActions",
"space c f": "editor::Format",
"space c r ": "editor::Rename",
// === Git ===
"space g b": "git::Blame",
"space g B": "editor::OpenPermalinkToLine",
"space g Y": "editor::CopyPermalinkToLine",
"space g h d": "editor::ExpandAllDiffHunks",
"space g h D": "git::Diff",
"space g h r": "git::Restore",
"space g h R": "git::RestoreFile",
// === Marks ===
"space h": "vim::ToggleMarksView",
// === Markdown ===
"space m p": "markdown::OpenPreview",
"space m P": "markdown::OpenPreviewToTheSide",
// === Search ===
"space s r": ["pane::DeploySearch", { "replace_enabled": true }],
"space s s": "outline::Toggle",
"space s w": "pane::DeploySearch",
// === Tasks ===
"space t L": ["task::Rerun", { "reevaluate_context": true }],
"space t l": "task::Rerun",
"space t n": ["editor::SpawnNearestTask", { "reveal": "no_focus" }],
"space t r": "task::Spawn",
// === UI Toggles ===
"space u i": "editor::ToggleInlayHints",
"space u w": "editor::ToggleSoftWrap",
"space u z": "workspace::ToggleCenteredLayout",
// === Extras ===
// "space x t": ["pane::DeploySearch", { "query": "TODO|FIXME|NOTE|BUG|HACK|XXX|WARN", "regex": true }],
// === Motions (display lines) ===
"j": ["vim::Down", { "display_lines": true }],
"k": ["vim::Up", { "display_lines": true }],
// === Yank/Paste ===
"shift-y": ["workspace::SendKeystrokes", "y $"],
"g y": ["workspace::SendKeystrokes", "\" + y"], // yank to + register
"g p": "editor::Paste",
// === Syntax-aware selection ===
"ctrl-space": "editor::SelectLargerSyntaxNode",
"backspace": "editor::SelectSmallerSyntaxNode",
// === Navigation ===
"g r": "editor::FindAllReferences",
"g f": "editor::OpenExcerpts",
"ctrl-t": "pane::GoToOlderTag", // jump back in go-to-definition tag stack
"ctrl-i": "pane::GoToNewerTag", // jump forward in go-to-definition tag stack
// === Diagnostics (errors only) ===
"] e": ["editor::GoToDiagnostic", { "severity": "error" }],
"[ e": ["editor::GoToPreviousDiagnostic", { "severity": "error" }],
// === Line movement ===
"alt-k": "editor::MoveLineUp",
"alt-j": "editor::MoveLineDown",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM CONTROL: Motion overrides
// - J: join lines without moving cursor (mark z, join, return)
// - f/t/F/T: multiline find (can jump across lines)
// - gs-prefix: surround operations (like mini.surround)
// - ctrl-u/d: scroll with auto-center
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "VimControl && !menu",
"bindings": {
// Join without cursor jump
"J": ["workspace::SendKeystrokes", "m z J ` z"],
// Multiline f/t motions
"f": ["vim::PushFindForward", { "before": false, "multiline": true }],
"t": ["vim::PushFindForward", { "before": true, "multiline": true }],
"shift-f": ["vim::PushFindBackward", { "after": false, "multiline": true }],
"shift-t": ["vim::PushFindBackward", { "after": true, "multiline": true }],
// Surround with gs prefix (mini.surround style)
"g s a": ["vim::PushAddSurrounds", {}],
"g s r": ["vim::PushChangeSurrounds", {}],
"g s d": "vim::PushDeleteSurrounds",
// Centered scrolling
"ctrl-u": ["workspace::SendKeystrokes", "ctrl-u z z"],
"ctrl-d": ["workspace::SendKeystrokes", "ctrl-d z z"],
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM NORMAL MODE: Q to close buffer
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Editor && vim_mode == normal && (vim_operator == none || vim_operator == n) && !VimWaiting",
"bindings": {
"Q": "pane::CloseActiveItem",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM SNEAK: s/S for two-char find (like vim-sneak)
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "vim_mode == normal || vim_mode == visual",
"bindings": {
"s": "vim::PushSneak",
"S": "vim::PushSneakBackward",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM VISUAL MODE
// - p/P: paste without overwriting register
// - S: surround selection
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Editor && vim_mode == visual && !VimWaiting && !VimObject",
"bindings": {
"p": ["vim::Paste", { "preserve_clipboard": true }],
"shift-p": ["vim::Paste", { "preserve_clipboard": true }],
"shift-s": ["vim::PushAddSurrounds", {}],
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// PROJECT PANEL: Vim-style navigation (oil.nvim / netrw inspired)
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "ProjectPanel && not_editing",
"bindings": {
// Fold/unfold
"z c": "project_panel::CollapseSelectedEntry",
"z o": "project_panel::ExpandSelectedEntry",
// File operations
"shift-o": "project_panel::RevealInFileManager",
"r": "project_panel::Rename",
"x": "project_panel::Cut",
"y": "project_panel::Copy",
"p": "project_panel::Paste",
"d": "project_panel::Trash",
"shift-d": ["project_panel::Trash", { "skip_prompt": true }],
"a": "project_panel::NewFile",
"shift-a": "project_panel::NewDirectory",
// Path copying
"shift-y": "workspace::CopyRelativePath",
"g y": "workspace::CopyPath",
// Close
"q": "workspace::ToggleLeftDock",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// TERMINAL
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Terminal",
"bindings": {
"cmd-t": "workspace::NewTerminal",
"cmd-n": "workspace::NewCenterTerminal",
"alt-right": "pane::ActivateNextItem",
"alt-left": "pane::ActivatePreviousItem",
"alt-,": "pane::SwapItemLeft",
"alt-.": "pane::SwapItemRight",
"alt-p": "pane::TogglePinTab",
"cmd-shift-g": "git_panel::ToggleFocus",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// TAB SWITCHER: vim-style j/k navigation
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "TabSwitcher",
"bindings": {
"k": "menu::SelectPrevious",
"j": "menu::SelectNext",
"x": "tab_switcher::CloseSelectedItem",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// PANE: Splits & Tab switching by number
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "Pane",
"bindings": {
"ctrl-w s": "pane::SplitDown",
"cmd-shift-d": "pane::SplitDown",
"ctrl-w v": "pane::SplitRight",
"cmd-d": "pane::SplitRight",
// Tab by number
"cmd-1": ["pane::ActivateItem", 0],
"cmd-2": ["pane::ActivateItem", 1],
"cmd-3": ["pane::ActivateItem", 2],
"cmd-4": ["pane::ActivateItem", 3],
"cmd-5": ["pane::ActivateItem", 4],
"cmd-6": ["pane::ActivateItem", 5],
"cmd-7": ["pane::ActivateItem", 6],
"cmd-8": ["pane::ActivateItem", 7],
"cmd-9": ["pane::ActivateItem", 8],
"cmd-0": "pane::ActivateLastItem",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM OPERATORS: Git integration
// - d o: expand all diff hunks
// - d r: restore hunk
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "vim_operator == d",
"bindings": {
"o": "editor::ExpandAllDiffHunks",
"r": "git::Restore",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM TEXT OBJECTS: mini.ai style
// - Q: any quote type
// - B: any bracket type
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "vim_operator == a || vim_operator == i || vim_operator == cs",
"bindings": {
"Q": "vim::MiniQuotes",
"B": "vim::MiniBrackets",
},
},
// ═══════════════════════════════════════════════════════════════════════════════
// VIM VISUAL: Exchange (swap two selections)
// ═══════════════════════════════════════════════════════════════════════════════
{
"context": "vim_mode == visual",
"bindings": {
"shift-x": "vim::Exchange",
},
},
]