1[
2 // Standard macOS bindings
3 {
4 "use_key_equivalents": true,
5 "bindings": {
6 "f4": "debugger::Start",
7 "shift-f5": "debugger::Stop",
8 "shift-cmd-f5": "debugger::RerunSession",
9 "f6": "debugger::Pause",
10 "f7": "debugger::StepOver",
11 "ctrl-f11": "debugger::StepInto",
12 "shift-f11": "debugger::StepOut",
13 "home": "menu::SelectFirst",
14 "shift-pageup": "menu::SelectFirst",
15 "pageup": "menu::SelectFirst",
16 "cmd-up": "menu::SelectFirst",
17 "end": "menu::SelectLast",
18 "shift-pagedown": "menu::SelectLast",
19 "pagedown": "menu::SelectLast",
20 "cmd-down": "menu::SelectLast",
21 "tab": "menu::SelectNext",
22 "ctrl-n": "menu::SelectNext",
23 "down": "menu::SelectNext",
24 "shift-tab": "menu::SelectPrevious",
25 "ctrl-p": "menu::SelectPrevious",
26 "up": "menu::SelectPrevious",
27 "enter": "menu::Confirm",
28 "ctrl-enter": "menu::SecondaryConfirm",
29 "cmd-enter": "menu::SecondaryConfirm",
30 "cmd-escape": "menu::Cancel",
31 "ctrl-escape": "menu::Cancel",
32 "ctrl-c": "menu::Cancel",
33 "escape": "menu::Cancel",
34 "alt-shift-enter": "menu::Restart",
35 "cmd-shift-w": "workspace::CloseWindow",
36 "shift-escape": "workspace::ToggleZoom",
37 "cmd-o": "workspace::Open",
38 "cmd-=": ["zed::IncreaseBufferFontSize", { "persist": false }],
39 "cmd-+": ["zed::IncreaseBufferFontSize", { "persist": false }],
40 "cmd--": ["zed::DecreaseBufferFontSize", { "persist": false }],
41 "cmd-0": ["zed::ResetBufferFontSize", { "persist": false }],
42 "cmd-,": "zed::OpenSettingsEditor",
43 "cmd-alt-,": "zed::OpenSettings",
44 "cmd-q": "zed::Quit",
45 "cmd-h": "zed::Hide",
46 "alt-cmd-h": "zed::HideOthers",
47 "cmd-m": "zed::Minimize",
48 "fn-f": "zed::ToggleFullScreen",
49 "ctrl-cmd-f": "zed::ToggleFullScreen",
50 "ctrl-cmd-z": "edit_prediction::RateCompletions",
51 "ctrl-cmd-i": "edit_prediction::ToggleMenu",
52 "ctrl-cmd-l": "lsp_tool::ToggleMenu"
53 }
54 },
55 {
56 "context": "Editor",
57 "use_key_equivalents": true,
58 "bindings": {
59 "escape": "editor::Cancel",
60 "shift-backspace": "editor::Backspace",
61 "ctrl-h": "editor::Backspace",
62 "backspace": "editor::Backspace",
63 "ctrl-d": "editor::Delete",
64 "delete": "editor::Delete",
65 "tab": "editor::Tab",
66 "shift-tab": "editor::Backtab",
67 "ctrl-t": "editor::Transpose",
68 "ctrl-k": "editor::KillRingCut",
69 "ctrl-y": "editor::KillRingYank",
70 "cmd-k cmd-q": "editor::Rewrap",
71 "cmd-k q": "editor::Rewrap",
72 "cmd-backspace": "editor::DeleteToBeginningOfLine",
73 "cmd-delete": "editor::DeleteToEndOfLine",
74 "alt-backspace": ["editor::DeleteToPreviousWordStart", { "ignore_newlines": false, "ignore_brackets": false }],
75 "ctrl-w": ["editor::DeleteToPreviousWordStart", { "ignore_newlines": false, "ignore_brackets": false }],
76 "alt-delete": ["editor::DeleteToNextWordEnd", { "ignore_newlines": false, "ignore_brackets": false }],
77 "cmd-x": "editor::Cut",
78 "cmd-c": "editor::Copy",
79 "cmd-v": "editor::Paste",
80 "cmd-z": "editor::Undo",
81 "cmd-shift-z": "editor::Redo",
82 "up": "editor::MoveUp",
83 "ctrl-up": "editor::MoveToStartOfParagraph",
84 "pageup": "editor::MovePageUp",
85 "shift-pageup": "editor::SelectPageUp",
86 "cmd-pageup": "editor::PageUp",
87 "ctrl-pageup": "editor::LineUp",
88 "down": "editor::MoveDown",
89 "ctrl-down": "editor::MoveToEndOfParagraph",
90 "pagedown": "editor::MovePageDown",
91 "shift-pagedown": "editor::SelectPageDown",
92 "cmd-pagedown": "editor::PageDown",
93 "ctrl-pagedown": "editor::LineDown",
94 "ctrl-p": "editor::MoveUp",
95 "ctrl-n": "editor::MoveDown",
96 "ctrl-b": "editor::MoveLeft",
97 "left": "editor::MoveLeft",
98 "ctrl-f": "editor::MoveRight",
99 "right": "editor::MoveRight",
100 "ctrl-l": "editor::ScrollCursorCenter",
101 "alt-left": "editor::MoveToPreviousWordStart",
102 "alt-right": "editor::MoveToNextWordEnd",
103 "cmd-left": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
104 "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false, "stop_at_indent": true }],
105 "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
106 "cmd-right": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }],
107 "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }],
108 "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }],
109 "cmd-up": "editor::MoveToBeginning",
110 "cmd-down": "editor::MoveToEnd",
111 "cmd-home": "editor::MoveToBeginning", // Typed via `cmd-fn-left`
112 "cmd-end": "editor::MoveToEnd", // Typed via `cmd-fn-right`
113 "shift-up": "editor::SelectUp",
114 "ctrl-shift-p": "editor::SelectUp",
115 "shift-down": "editor::SelectDown",
116 "ctrl-shift-n": "editor::SelectDown",
117 "shift-left": "editor::SelectLeft",
118 "ctrl-shift-b": "editor::SelectLeft",
119 "shift-right": "editor::SelectRight",
120 "ctrl-shift-f": "editor::SelectRight",
121 "alt-shift-left": "editor::SelectToPreviousWordStart", // cursorWordLeftSelect
122 "alt-shift-right": "editor::SelectToNextWordEnd", // cursorWordRightSelect
123 "ctrl-shift-up": "editor::SelectToStartOfParagraph",
124 "ctrl-shift-down": "editor::SelectToEndOfParagraph",
125 "cmd-shift-up": "editor::SelectToBeginning",
126 "cmd-shift-down": "editor::SelectToEnd",
127 "cmd-a": "editor::SelectAll",
128 "cmd-l": "editor::SelectLine",
129 "cmd-shift-i": "editor::Format",
130 "alt-shift-o": "editor::OrganizeImports",
131 "cmd-shift-left": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
132 "shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
133 "ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
134 "cmd-shift-right": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
135 "shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
136 "ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
137 "ctrl-v": ["editor::MovePageDown", { "center_cursor": true }],
138 "ctrl-shift-v": ["editor::MovePageUp", { "center_cursor": true }],
139 "ctrl-cmd-space": "editor::ShowCharacterPalette",
140 "cmd-;": "editor::ToggleLineNumbers",
141 "cmd-'": "editor::ToggleSelectedDiffHunks",
142 "cmd-\"": "editor::ExpandAllDiffHunks",
143 "cmd-alt-g b": "git::Blame",
144 "cmd-alt-g m": "git::OpenModifiedFiles",
145 "cmd-i": "editor::ShowSignatureHelp",
146 "f9": "editor::ToggleBreakpoint",
147 "shift-f9": "editor::EditLogBreakpoint",
148 "ctrl-f12": "editor::GoToDeclaration",
149 "alt-ctrl-f12": "editor::GoToDeclarationSplit",
150 "ctrl-cmd-e": "editor::ToggleEditPrediction"
151 }
152 },
153 {
154 "context": "Editor && mode == full",
155 "use_key_equivalents": true,
156 "bindings": {
157 "shift-enter": "editor::Newline",
158 "enter": "editor::Newline",
159 "cmd-enter": "editor::NewlineBelow",
160 "cmd-shift-enter": "editor::NewlineAbove",
161 "cmd-k z": "editor::ToggleSoftWrap",
162 "cmd-f": "buffer_search::Deploy",
163 "cmd-alt-f": "buffer_search::DeployReplace",
164 "cmd-alt-l": ["buffer_search::Deploy", { "selection_search_enabled": true }],
165 "cmd-e": ["buffer_search::Deploy", { "focus": false }],
166 "cmd->": "agent::QuoteSelection",
167 "cmd-<": "assistant::InsertIntoEditor",
168 "cmd-alt-e": "editor::SelectEnclosingSymbol",
169 "alt-enter": "editor::OpenSelectionsInMultibuffer"
170 }
171 },
172 {
173 "context": "Editor && multibuffer",
174 "use_key_equivalents": true,
175 "bindings": {
176 "cmd-up": "editor::MoveToStartOfExcerpt",
177 "cmd-down": "editor::MoveToStartOfNextExcerpt",
178 "cmd-shift-up": "editor::SelectToStartOfExcerpt",
179 "cmd-shift-down": "editor::SelectToStartOfNextExcerpt"
180 }
181 },
182 {
183 "context": "Editor && mode == full && edit_prediction",
184 "use_key_equivalents": true,
185 "bindings": {
186 "alt-tab": "editor::NextEditPrediction",
187 "alt-shift-tab": "editor::PreviousEditPrediction"
188 }
189 },
190 {
191 "context": "Editor && !edit_prediction",
192 "use_key_equivalents": true,
193 "bindings": {
194 "alt-tab": "editor::ShowEditPrediction"
195 }
196 },
197 {
198 "context": "Editor && mode == auto_height",
199 "use_key_equivalents": true,
200 "bindings": {
201 "ctrl-enter": "editor::Newline",
202 "shift-enter": "editor::Newline",
203 "ctrl-shift-enter": "editor::NewlineBelow"
204 }
205 },
206 {
207 "context": "Markdown",
208 "use_key_equivalents": true,
209 "bindings": {
210 "cmd-c": "markdown::Copy"
211 }
212 },
213 {
214 "context": "Editor && jupyter && !ContextEditor",
215 "use_key_equivalents": true,
216 "bindings": {
217 "ctrl-shift-enter": "repl::Run",
218 "ctrl-alt-enter": "repl::RunInPlace"
219 }
220 },
221 {
222 "context": "Editor && !agent_diff && !AgentPanel",
223 "use_key_equivalents": true,
224 "bindings": {
225 "cmd-alt-z": "git::Restore",
226 "cmd-alt-y": "git::ToggleStaged",
227 "cmd-y": "git::StageAndNext",
228 "cmd-shift-y": "git::UnstageAndNext"
229 }
230 },
231 {
232 "context": "AgentDiff",
233 "use_key_equivalents": true,
234 "bindings": {
235 "cmd-y": "agent::Keep",
236 "cmd-n": "agent::Reject",
237 "cmd-shift-y": "agent::KeepAll",
238 "cmd-shift-n": "agent::RejectAll"
239 }
240 },
241 {
242 "context": "Editor && editor_agent_diff",
243 "use_key_equivalents": true,
244 "bindings": {
245 "cmd-y": "agent::Keep",
246 "cmd-n": "agent::Reject",
247 "cmd-shift-y": "agent::KeepAll",
248 "cmd-shift-n": "agent::RejectAll",
249 "shift-ctrl-r": "agent::OpenAgentDiff"
250 }
251 },
252 {
253 "context": "ContextEditor > Editor",
254 "use_key_equivalents": true,
255 "bindings": {
256 "cmd-enter": "assistant::Assist",
257 "cmd-s": "workspace::Save",
258 "cmd-<": "assistant::InsertIntoEditor",
259 "shift-enter": "assistant::Split",
260 "ctrl-r": "assistant::CycleMessageRole",
261 "enter": "assistant::ConfirmCommand",
262 "alt-enter": "editor::Newline",
263 "cmd-k c": "assistant::CopyCode",
264 "cmd-g": "search::SelectNextMatch",
265 "cmd-shift-g": "search::SelectPreviousMatch",
266 "cmd-k l": "agent::OpenRulesLibrary"
267 }
268 },
269 {
270 "context": "AgentPanel",
271 "use_key_equivalents": true,
272 "bindings": {
273 "cmd-n": "agent::NewThread",
274 "cmd-alt-n": "agent::NewTextThread",
275 "cmd-shift-h": "agent::OpenHistory",
276 "cmd-alt-c": "agent::OpenSettings",
277 "cmd-alt-p": "agent::OpenRulesLibrary",
278 "cmd-i": "agent::ToggleProfileSelector",
279 "cmd-alt-/": "agent::ToggleModelSelector",
280 "cmd-shift-a": "agent::ToggleContextPicker",
281 "cmd-shift-j": "agent::ToggleNavigationMenu",
282 "cmd-shift-i": "agent::ToggleOptionsMenu",
283 "cmd-alt-shift-n": "agent::ToggleNewThreadMenu",
284 "shift-alt-escape": "agent::ExpandMessageEditor",
285 "cmd->": "agent::QuoteSelection",
286 "cmd-alt-e": "agent::RemoveAllContext",
287 "cmd-shift-e": "project_panel::ToggleFocus",
288 "cmd-ctrl-b": "agent::ToggleBurnMode",
289 "cmd-shift-enter": "agent::ContinueThread",
290 "alt-enter": "agent::ContinueWithBurnMode",
291 "cmd-y": "agent::AllowOnce",
292 "cmd-alt-y": "agent::AllowAlways",
293 "cmd-alt-z": "agent::RejectOnce"
294 }
295 },
296 {
297 "context": "AgentPanel > NavigationMenu",
298 "bindings": {
299 "shift-backspace": "agent::DeleteRecentlyOpenThread"
300 }
301 },
302 {
303 "context": "AgentPanel > Markdown",
304 "use_key_equivalents": true,
305 "bindings": {
306 "cmd-c": "markdown::CopyAsMarkdown"
307 }
308 },
309 {
310 "context": "AgentPanel && prompt_editor",
311 "use_key_equivalents": true,
312 "bindings": {
313 "cmd-n": "agent::NewTextThread",
314 "cmd-alt-t": "agent::NewThread"
315 }
316 },
317 {
318 "context": "AgentPanel && external_agent_thread",
319 "use_key_equivalents": true,
320 "bindings": {
321 "cmd-n": "agent::NewExternalAgentThread",
322 "cmd-alt-t": "agent::NewThread"
323 }
324 },
325 {
326 "context": "MessageEditor && !Picker > Editor && !use_modifier_to_send",
327 "use_key_equivalents": true,
328 "bindings": {
329 "enter": "agent::Chat",
330 "cmd-enter": "agent::ChatWithFollow",
331 "cmd-i": "agent::ToggleProfileSelector",
332 "shift-ctrl-r": "agent::OpenAgentDiff",
333 "cmd-shift-y": "agent::KeepAll",
334 "cmd-shift-n": "agent::RejectAll"
335 }
336 },
337 {
338 "context": "MessageEditor && !Picker > Editor && use_modifier_to_send",
339 "use_key_equivalents": true,
340 "bindings": {
341 "cmd-enter": "agent::Chat",
342 "enter": "editor::Newline",
343 "cmd-i": "agent::ToggleProfileSelector",
344 "shift-ctrl-r": "agent::OpenAgentDiff",
345 "cmd-shift-y": "agent::KeepAll",
346 "cmd-shift-n": "agent::RejectAll"
347 }
348 },
349 {
350 "context": "EditMessageEditor > Editor",
351 "use_key_equivalents": true,
352 "bindings": {
353 "escape": "menu::Cancel",
354 "enter": "menu::Confirm",
355 "alt-enter": "editor::Newline"
356 }
357 },
358 {
359 "context": "AgentFeedbackMessageEditor > Editor",
360 "use_key_equivalents": true,
361 "bindings": {
362 "escape": "menu::Cancel",
363 "enter": "menu::Confirm",
364 "alt-enter": "editor::Newline"
365 }
366 },
367 {
368 "context": "ContextStrip",
369 "use_key_equivalents": true,
370 "bindings": {
371 "up": "agent::FocusUp",
372 "right": "agent::FocusRight",
373 "left": "agent::FocusLeft",
374 "down": "agent::FocusDown",
375 "backspace": "agent::RemoveFocusedContext",
376 "enter": "agent::AcceptSuggestedContext"
377 }
378 },
379 {
380 "context": "AgentConfiguration",
381 "bindings": {
382 "ctrl--": "pane::GoBack"
383 }
384 },
385 {
386 "context": "AcpThread > ModeSelector",
387 "bindings": {
388 "cmd-enter": "menu::Confirm"
389 }
390 },
391 {
392 "context": "AcpThread > Editor && !use_modifier_to_send",
393 "use_key_equivalents": true,
394 "bindings": {
395 "enter": "agent::Chat",
396 "shift-ctrl-r": "agent::OpenAgentDiff",
397 "cmd-shift-y": "agent::KeepAll",
398 "cmd-shift-n": "agent::RejectAll",
399 "shift-tab": "agent::CycleModeSelector"
400 }
401 },
402 {
403 "context": "AcpThread > Editor && use_modifier_to_send",
404 "use_key_equivalents": true,
405 "bindings": {
406 "cmd-enter": "agent::Chat",
407 "shift-ctrl-r": "agent::OpenAgentDiff",
408 "cmd-shift-y": "agent::KeepAll",
409 "cmd-shift-n": "agent::RejectAll",
410 "shift-tab": "agent::CycleModeSelector"
411 }
412 },
413 {
414 "context": "ThreadHistory",
415 "bindings": {
416 "ctrl--": "pane::GoBack"
417 }
418 },
419 {
420 "context": "ThreadHistory > Editor",
421 "bindings": {
422 "shift-backspace": "agent::RemoveSelectedThread"
423 }
424 },
425 {
426 "context": "PromptLibrary",
427 "use_key_equivalents": true,
428 "bindings": {
429 "cmd-n": "rules_library::NewRule",
430 "cmd-shift-s": "rules_library::ToggleDefaultRule",
431 "cmd-w": "workspace::CloseWindow"
432 }
433 },
434 {
435 "context": "SettingsWindow",
436 "use_key_equivalents": true,
437 "bindings": {
438 "cmd-w": "workspace::CloseWindow"
439 }
440 },
441 {
442 "context": "BufferSearchBar",
443 "use_key_equivalents": true,
444 "bindings": {
445 "escape": "buffer_search::Dismiss",
446 "tab": "buffer_search::FocusEditor",
447 "enter": "search::SelectNextMatch",
448 "shift-enter": "search::SelectPreviousMatch",
449 "alt-enter": "search::SelectAllMatches",
450 "cmd-f": "search::FocusSearch",
451 "cmd-alt-f": "search::ToggleReplace",
452 "cmd-alt-l": "search::ToggleSelection",
453 "cmd-shift-o": "outline::Toggle"
454 }
455 },
456 {
457 "context": "BufferSearchBar && in_replace > Editor",
458 "use_key_equivalents": true,
459 "bindings": {
460 "enter": "search::ReplaceNext",
461 "cmd-enter": "search::ReplaceAll"
462 }
463 },
464 {
465 "context": "BufferSearchBar && !in_replace > Editor",
466 "use_key_equivalents": true,
467 "bindings": {
468 "up": "search::PreviousHistoryQuery",
469 "down": "search::NextHistoryQuery"
470 }
471 },
472 {
473 "context": "ProjectSearchBar",
474 "use_key_equivalents": true,
475 "bindings": {
476 "escape": "project_search::ToggleFocus",
477 "cmd-shift-j": "project_search::ToggleFilters",
478 "cmd-shift-f": "search::FocusSearch",
479 "cmd-shift-h": "search::ToggleReplace",
480 "alt-cmd-g": "search::ToggleRegex",
481 "alt-cmd-x": "search::ToggleRegex"
482 }
483 },
484 {
485 "context": "ProjectSearchBar > Editor",
486 "use_key_equivalents": true,
487 "bindings": {
488 "up": "search::PreviousHistoryQuery",
489 "down": "search::NextHistoryQuery"
490 }
491 },
492 {
493 "context": "ProjectSearchBar && in_replace > Editor",
494 "use_key_equivalents": true,
495 "bindings": {
496 "enter": "search::ReplaceNext",
497 "cmd-enter": "search::ReplaceAll"
498 }
499 },
500 {
501 "context": "ProjectSearchView",
502 "use_key_equivalents": true,
503 "bindings": {
504 "escape": "project_search::ToggleFocus",
505 "cmd-shift-j": "project_search::ToggleFilters",
506 "cmd-shift-h": "search::ToggleReplace",
507 "alt-cmd-g": "search::ToggleRegex",
508 "alt-cmd-x": "search::ToggleRegex"
509 }
510 },
511 {
512 "context": "Pane",
513 "use_key_equivalents": true,
514 "bindings": {
515 "alt-cmd-left": "pane::ActivatePreviousItem",
516 "cmd-{": "pane::ActivatePreviousItem",
517 "alt-cmd-right": "pane::ActivateNextItem",
518 "cmd-}": "pane::ActivateNextItem",
519 "ctrl-shift-pageup": "pane::SwapItemLeft",
520 "ctrl-shift-pagedown": "pane::SwapItemRight",
521 "cmd-w": ["pane::CloseActiveItem", { "close_pinned": false }],
522 "alt-cmd-t": ["pane::CloseOtherItems", { "close_pinned": false }],
523 "ctrl-alt-cmd-w": "workspace::CloseInactiveTabsAndPanes",
524 "cmd-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }],
525 "cmd-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }],
526 "cmd-k u": ["pane::CloseCleanItems", { "close_pinned": false }],
527 "cmd-k w": ["pane::CloseAllItems", { "close_pinned": false }],
528 "cmd-k cmd-w": "workspace::CloseAllItemsAndPanes",
529 "cmd-f": "project_search::ToggleFocus",
530 "cmd-g": "search::SelectNextMatch",
531 "cmd-shift-g": "search::SelectPreviousMatch",
532 "cmd-shift-h": "search::ToggleReplace",
533 "cmd-alt-l": "search::ToggleSelection",
534 "alt-enter": "search::SelectAllMatches",
535 "alt-cmd-c": "search::ToggleCaseSensitive",
536 "alt-cmd-w": "search::ToggleWholeWord",
537 "alt-cmd-f": "project_search::ToggleFilters",
538 "alt-cmd-x": "search::ToggleRegex",
539 "cmd-k shift-enter": "pane::TogglePinTab"
540 }
541 },
542 // Bindings from VS Code
543 {
544 "context": "Editor",
545 "use_key_equivalents": true,
546 "bindings": {
547 "cmd-[": "editor::Outdent",
548 "cmd-]": "editor::Indent",
549 "cmd-ctrl-p": "editor::AddSelectionAbove", // Insert cursor above
550 "cmd-alt-up": "editor::AddSelectionAbove",
551 "cmd-ctrl-n": "editor::AddSelectionBelow", // Insert cursor below
552 "cmd-alt-down": "editor::AddSelectionBelow",
553 "cmd-shift-k": "editor::DeleteLine",
554 "alt-up": "editor::MoveLineUp",
555 "alt-down": "editor::MoveLineDown",
556 "alt-shift-up": "editor::DuplicateLineUp",
557 "alt-shift-down": "editor::DuplicateLineDown",
558 "cmd-ctrl-left": "editor::SelectSmallerSyntaxNode", // Shrink selection
559 "cmd-ctrl-right": "editor::SelectLargerSyntaxNode", // Expand selection
560 "cmd-ctrl-up": "editor::SelectPreviousSyntaxNode", // Move selection up
561 "ctrl-shift-right": "editor::SelectLargerSyntaxNode", // Expand selection (VSCode version)
562 "ctrl-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink selection (VSCode version)
563 "cmd-ctrl-down": "editor::SelectNextSyntaxNode", // Move selection down
564 "cmd-d": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch / find_under_expand
565 "cmd-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection
566 "cmd-f2": "editor::SelectAllMatches", // Select all occurrences of current word
567 "cmd-k cmd-d": ["editor::SelectNext", { "replace_newest": true }], // editor.action.moveSelectionToNextFindMatch / find_under_expand_skip
568 // macOS binds `ctrl-cmd-d` to Show Dictionary which breaks these two binds
569 // To use `ctrl-cmd-d` or `ctrl-k ctrl-cmd-d` in Zed you must execute this command and then restart:
570 // defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '<dict><key>enabled</key><false/></dict>'
571 "ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": false }], // editor.action.addSelectionToPreviousFindMatch
572 "cmd-k ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": true }], // editor.action.moveSelectionToPreviousFindMatch
573 "cmd-k cmd-i": "editor::Hover",
574 "cmd-k cmd-b": "editor::BlameHover",
575 "cmd-/": ["editor::ToggleComments", { "advance_downwards": false }],
576 "f8": ["editor::GoToDiagnostic", { "severity": { "min": "hint", "max": "error" } }],
577 "shift-f8": ["editor::GoToPreviousDiagnostic", { "severity": { "min": "hint", "max": "error" } }],
578 "f2": "editor::Rename",
579 "f12": "editor::GoToDefinition",
580 "alt-f12": "editor::GoToDefinitionSplit",
581 "cmd-f12": "editor::GoToTypeDefinition",
582 "shift-f12": "editor::GoToImplementation",
583 "alt-cmd-f12": "editor::GoToTypeDefinitionSplit",
584 "alt-shift-f12": "editor::FindAllReferences",
585 "cmd-|": "editor::MoveToEnclosingBracket",
586 "ctrl-m": "editor::MoveToEnclosingBracket", // From Jetbrains
587 "alt-cmd-[": "editor::Fold",
588 "alt-cmd-]": "editor::UnfoldLines",
589 "cmd-k cmd-l": "editor::ToggleFold",
590 "cmd-k cmd-[": "editor::FoldRecursive",
591 "cmd-k cmd-]": "editor::UnfoldRecursive",
592 "cmd-k cmd-1": ["editor::FoldAtLevel", 1],
593 "cmd-k cmd-2": ["editor::FoldAtLevel", 2],
594 "cmd-k cmd-3": ["editor::FoldAtLevel", 3],
595 "cmd-k cmd-4": ["editor::FoldAtLevel", 4],
596 "cmd-k cmd-5": ["editor::FoldAtLevel", 5],
597 "cmd-k cmd-6": ["editor::FoldAtLevel", 6],
598 "cmd-k cmd-7": ["editor::FoldAtLevel", 7],
599 "cmd-k cmd-8": ["editor::FoldAtLevel", 8],
600 "cmd-k cmd-9": ["editor::FoldAtLevel", 9],
601 "cmd-k cmd-0": "editor::FoldAll",
602 "cmd-k cmd-j": "editor::UnfoldAll",
603 // Using `ctrl-space` / `ctrl-shift-space` in Zed requires disabling the macOS global shortcut.
604 // System Preferences->Keyboard->Keyboard Shortcuts->Input Sources->Select the previous input source (uncheck)
605 "ctrl-space": "editor::ShowCompletions",
606 "ctrl-shift-space": "editor::ShowWordCompletions",
607 "cmd-.": "editor::ToggleCodeActions",
608 "cmd-k r": "editor::RevealInFileManager",
609 "cmd-k p": "editor::CopyPath",
610 "cmd-\\": "pane::SplitRight",
611 "ctrl-cmd-c": "editor::DisplayCursorNames"
612 }
613 },
614 {
615 "context": "Editor && extension == md",
616 "use_key_equivalents": true,
617 "bindings": {
618 "cmd-k v": "markdown::OpenPreviewToTheSide",
619 "cmd-shift-v": "markdown::OpenPreview"
620 }
621 },
622 {
623 "context": "Editor && extension == svg",
624 "use_key_equivalents": true,
625 "bindings": {
626 "cmd-k v": "svg::OpenPreviewToTheSide",
627 "cmd-shift-v": "svg::OpenPreview"
628 }
629 },
630 {
631 "context": "Editor && mode == full",
632 "use_key_equivalents": true,
633 "bindings": {
634 "cmd-shift-o": "outline::Toggle",
635 "ctrl-g": "go_to_line::Toggle",
636 "cmd-shift-backspace": "editor::GoToPreviousChange",
637 "cmd-shift-alt-backspace": "editor::GoToNextChange"
638 }
639 },
640 {
641 "context": "Pane",
642 "use_key_equivalents": true,
643 "bindings": {
644 "ctrl-1": ["pane::ActivateItem", 0],
645 "ctrl-2": ["pane::ActivateItem", 1],
646 "ctrl-3": ["pane::ActivateItem", 2],
647 "ctrl-4": ["pane::ActivateItem", 3],
648 "ctrl-5": ["pane::ActivateItem", 4],
649 "ctrl-6": ["pane::ActivateItem", 5],
650 "ctrl-7": ["pane::ActivateItem", 6],
651 "ctrl-8": ["pane::ActivateItem", 7],
652 "ctrl-9": ["pane::ActivateItem", 8],
653 "ctrl-0": "pane::ActivateLastItem",
654 "ctrl--": "pane::GoBack",
655 "ctrl-_": "pane::GoForward",
656 "cmd-shift-f": "pane::DeploySearch"
657 }
658 },
659 {
660 "context": "Workspace",
661 "use_key_equivalents": true,
662 "bindings": {
663 // Change the default action on `menu::Confirm` by setting the parameter
664 // "alt-cmd-o": ["projects::OpenRecent", {"create_new_window": true }],
665 "alt-cmd-o": ["projects::OpenRecent", { "create_new_window": false }],
666 "ctrl-cmd-o": ["projects::OpenRemote", { "from_existing_connection": false, "create_new_window": false }],
667 "ctrl-cmd-shift-o": ["projects::OpenRemote", { "from_existing_connection": true, "create_new_window": false }],
668 "cmd-ctrl-b": "branches::OpenRecent",
669 "ctrl-~": "workspace::NewTerminal",
670 "cmd-s": "workspace::Save",
671 "cmd-k s": "workspace::SaveWithoutFormat",
672 "alt-shift-enter": "toast::RunAction",
673 "cmd-shift-s": "workspace::SaveAs",
674 "cmd-shift-n": "workspace::NewWindow",
675 "ctrl-`": "terminal_panel::Toggle",
676 "cmd-1": ["workspace::ActivatePane", 0],
677 "cmd-2": ["workspace::ActivatePane", 1],
678 "cmd-3": ["workspace::ActivatePane", 2],
679 "cmd-4": ["workspace::ActivatePane", 3],
680 "cmd-5": ["workspace::ActivatePane", 4],
681 "cmd-6": ["workspace::ActivatePane", 5],
682 "cmd-7": ["workspace::ActivatePane", 6],
683 "cmd-8": ["workspace::ActivatePane", 7],
684 "cmd-9": ["workspace::ActivatePane", 8],
685 "cmd-b": "workspace::ToggleLeftDock",
686 "cmd-alt-b": "workspace::ToggleRightDock",
687 "cmd-r": "workspace::ToggleRightDock",
688 "cmd-j": "workspace::ToggleBottomDock",
689 "alt-cmd-y": "workspace::CloseAllDocks",
690 // For 0px parameter, uses UI font size value.
691 "ctrl-alt-0": "workspace::ResetActiveDockSize",
692 "ctrl-alt--": ["workspace::DecreaseActiveDockSize", { "px": 0 }],
693 "ctrl-alt-=": ["workspace::IncreaseActiveDockSize", { "px": 0 }],
694 "ctrl-alt-)": "workspace::ResetOpenDocksSize",
695 "ctrl-alt-_": ["workspace::DecreaseOpenDocksSize", { "px": 0 }],
696 "ctrl-alt-+": ["workspace::IncreaseOpenDocksSize", { "px": 0 }],
697 "cmd-shift-f": "pane::DeploySearch",
698 "cmd-shift-h": ["pane::DeploySearch", { "replace_enabled": true }],
699 "cmd-shift-t": "pane::ReopenClosedItem",
700 "cmd-k cmd-s": "zed::OpenKeymapEditor",
701 "cmd-k cmd-t": "theme_selector::Toggle",
702 "ctrl-alt-cmd-p": "settings_profile_selector::Toggle",
703 "cmd-t": "project_symbols::Toggle",
704 "cmd-p": "file_finder::Toggle",
705 "ctrl-tab": "tab_switcher::Toggle",
706 "ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }],
707 "cmd-shift-p": "command_palette::Toggle",
708 "cmd-shift-m": "diagnostics::Deploy",
709 "cmd-shift-e": "project_panel::ToggleFocus",
710 "cmd-shift-b": "outline_panel::ToggleFocus",
711 "ctrl-shift-g": "git_panel::ToggleFocus",
712 "cmd-shift-d": "debug_panel::ToggleFocus",
713 "cmd-?": "agent::ToggleFocus",
714 "cmd-alt-s": "workspace::SaveAll",
715 "cmd-k m": "language_selector::Toggle",
716 "cmd-k cmd-m": "toolchain::AddToolchain",
717 "escape": "workspace::Unfollow",
718 "cmd-k cmd-left": "workspace::ActivatePaneLeft",
719 "cmd-k cmd-right": "workspace::ActivatePaneRight",
720 "cmd-k cmd-up": "workspace::ActivatePaneUp",
721 "cmd-k cmd-down": "workspace::ActivatePaneDown",
722 "cmd-k shift-left": "workspace::SwapPaneLeft",
723 "cmd-k shift-right": "workspace::SwapPaneRight",
724 "cmd-k shift-up": "workspace::SwapPaneUp",
725 "cmd-k shift-down": "workspace::SwapPaneDown",
726 "cmd-shift-x": "zed::Extensions",
727 "f5": "debugger::Rerun",
728 "cmd-w": "workspace::CloseActiveDock"
729 }
730 },
731 {
732 "context": "Workspace && !Terminal",
733 "use_key_equivalents": true,
734 "bindings": {
735 "cmd-n": "workspace::NewFile",
736 "cmd-shift-r": "task::Spawn",
737 // All task parameters are captured and unchanged between reruns by default.
738 // Use the `"reevaluate_context"` parameter to control this.
739 "cmd-alt-r": ["task::Rerun", { "reevaluate_context": false }],
740 "ctrl-alt-shift-r": ["task::Spawn", { "reveal_target": "center" }]
741 // also possible to spawn tasks by name:
742 // "foo-bar": ["task::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }]
743 // or by tag:
744 // "foo-bar": ["task::Spawn", { "task_tag": "MyTag" }],
745 }
746 },
747 {
748 "context": "Workspace && debugger_running",
749 "use_key_equivalents": true,
750 "bindings": {
751 "f5": "zed::NoAction"
752 }
753 },
754 {
755 "context": "Workspace && debugger_stopped",
756 "use_key_equivalents": true,
757 "bindings": {
758 "f5": "debugger::Continue"
759 }
760 },
761 // Bindings from Sublime Text
762 {
763 "context": "Editor",
764 "use_key_equivalents": true,
765 "bindings": {
766 "cmd-u": "editor::UndoSelection",
767 "cmd-shift-u": "editor::RedoSelection",
768 "ctrl-j": "editor::JoinLines",
769 "ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart",
770 "ctrl-alt-h": "editor::DeleteToPreviousSubwordStart",
771 "ctrl-alt-delete": "editor::DeleteToNextSubwordEnd",
772 "ctrl-alt-d": "editor::DeleteToNextSubwordEnd",
773 "ctrl-alt-left": "editor::MoveToPreviousSubwordStart",
774 "ctrl-alt-b": "editor::MoveToPreviousSubwordStart",
775 "ctrl-alt-right": "editor::MoveToNextSubwordEnd",
776 "ctrl-alt-f": "editor::MoveToNextSubwordEnd",
777 "ctrl-alt-shift-left": "editor::SelectToPreviousSubwordStart",
778 "ctrl-alt-shift-b": "editor::SelectToPreviousSubwordStart",
779 "ctrl-alt-shift-right": "editor::SelectToNextSubwordEnd",
780 "ctrl-alt-shift-f": "editor::SelectToNextSubwordEnd"
781 }
782 },
783 // Bindings from Atom
784 {
785 "context": "Pane",
786 "use_key_equivalents": true,
787 "bindings": {
788 "cmd-k up": "pane::SplitUp",
789 "cmd-k down": "pane::SplitDown",
790 "cmd-k left": "pane::SplitLeft",
791 "cmd-k right": "pane::SplitRight"
792 }
793 },
794 // Bindings that should be unified with bindings for more general actions
795 {
796 "context": "Editor && renaming",
797 "use_key_equivalents": true,
798 "bindings": {
799 "enter": "editor::ConfirmRename"
800 }
801 },
802 {
803 "context": "Editor && showing_completions",
804 "use_key_equivalents": true,
805 "bindings": {
806 "enter": "editor::ConfirmCompletion",
807 "shift-enter": "editor::ConfirmCompletionReplace",
808 "tab": "editor::ComposeCompletion"
809 }
810 },
811 {
812 "context": "Editor && edit_prediction",
813 "bindings": {
814 "alt-tab": "editor::AcceptEditPrediction",
815 "tab": "editor::AcceptEditPrediction",
816 "ctrl-cmd-right": "editor::AcceptPartialEditPrediction"
817 }
818 },
819 {
820 "context": "Editor && edit_prediction_conflict",
821 "use_key_equivalents": true,
822 "bindings": {
823 "alt-tab": "editor::AcceptEditPrediction",
824 "ctrl-cmd-right": "editor::AcceptPartialEditPrediction"
825 }
826 },
827 {
828 "context": "Editor && showing_code_actions",
829 "use_key_equivalents": true,
830 "bindings": {
831 "enter": "editor::ConfirmCodeAction"
832 }
833 },
834 {
835 "context": "Editor && (showing_code_actions || showing_completions)",
836 "use_key_equivalents": true,
837 "bindings": {
838 "up": "editor::ContextMenuPrevious",
839 "ctrl-p": "editor::ContextMenuPrevious",
840 "down": "editor::ContextMenuNext",
841 "ctrl-n": "editor::ContextMenuNext",
842 "pageup": "editor::ContextMenuFirst",
843 "pagedown": "editor::ContextMenuLast"
844 }
845 },
846 {
847 "context": "Editor && showing_signature_help && !showing_completions",
848 "bindings": {
849 "up": "editor::SignatureHelpPrevious",
850 "down": "editor::SignatureHelpNext"
851 }
852 },
853 // Custom bindings
854 {
855 "use_key_equivalents": true,
856 "bindings": {
857 "ctrl-alt-cmd-f": "workspace::FollowNextCollaborator",
858 // TODO: Move this to a dock open action
859 "cmd-shift-c": "collab_panel::ToggleFocus",
860 // Only available in debug builds: opens an element inspector for development.
861 "cmd-alt-i": "dev::ToggleInspector"
862 }
863 },
864 {
865 "context": "!ContextEditor > Editor && mode == full",
866 "use_key_equivalents": true,
867 "bindings": {
868 "alt-enter": "editor::OpenExcerpts",
869 "shift-enter": "editor::ExpandExcerpts",
870 "cmd-alt-enter": "editor::OpenExcerptsSplit",
871 "cmd-shift-e": "pane::RevealInProjectPanel",
872 "cmd-f8": "editor::GoToHunk",
873 "cmd-shift-f8": "editor::GoToPreviousHunk",
874 "ctrl-enter": "assistant::InlineAssist",
875 "ctrl-:": "editor::ToggleInlayHints"
876 }
877 },
878 {
879 "context": "PromptEditor",
880 "use_key_equivalents": true,
881 "bindings": {
882 "cmd-shift-a": "agent::ToggleContextPicker",
883 "cmd-alt-/": "agent::ToggleModelSelector",
884 "cmd-alt-e": "agent::RemoveAllContext",
885 "ctrl-[": "agent::CyclePreviousInlineAssist",
886 "ctrl-]": "agent::CycleNextInlineAssist"
887 }
888 },
889 {
890 "context": "Prompt",
891 "use_key_equivalents": true,
892 "bindings": {
893 "left": "menu::SelectPrevious",
894 "right": "menu::SelectNext",
895 "h": "menu::SelectPrevious",
896 "l": "menu::SelectNext"
897 }
898 },
899 {
900 "context": "ProjectSearchBar && !in_replace",
901 "use_key_equivalents": true,
902 "bindings": {
903 "cmd-enter": "project_search::SearchInNew"
904 }
905 },
906 {
907 "context": "OutlinePanel && not_editing",
908 "use_key_equivalents": true,
909 "bindings": {
910 "escape": "menu::Cancel",
911 "left": "outline_panel::CollapseSelectedEntry",
912 "right": "outline_panel::ExpandSelectedEntry",
913 "cmd-alt-c": "workspace::CopyPath",
914 "alt-cmd-shift-c": "workspace::CopyRelativePath",
915 "alt-cmd-r": "outline_panel::RevealInFileManager",
916 "space": "outline_panel::OpenSelectedEntry",
917 "shift-down": "menu::SelectNext",
918 "shift-up": "menu::SelectPrevious",
919 "alt-enter": "editor::OpenExcerpts",
920 "cmd-alt-enter": "editor::OpenExcerptsSplit"
921 }
922 },
923 {
924 "context": "ProjectPanel",
925 "use_key_equivalents": true,
926 "bindings": {
927 "left": "project_panel::CollapseSelectedEntry",
928 "right": "project_panel::ExpandSelectedEntry",
929 "cmd-n": "project_panel::NewFile",
930 "cmd-d": "project_panel::Duplicate",
931 "alt-cmd-n": "project_panel::NewDirectory",
932 "cmd-x": "project_panel::Cut",
933 "cmd-c": "project_panel::Copy",
934 "cmd-v": "project_panel::Paste",
935 "cmd-alt-c": "workspace::CopyPath",
936 "alt-cmd-shift-c": "workspace::CopyRelativePath",
937 "enter": "project_panel::Rename",
938 "f2": "project_panel::Rename",
939 "backspace": ["project_panel::Trash", { "skip_prompt": false }],
940 "delete": ["project_panel::Trash", { "skip_prompt": false }],
941 "cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }],
942 "cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],
943 "alt-cmd-r": "project_panel::RevealInFileManager",
944 "ctrl-shift-enter": "workspace::OpenWithSystem",
945 "alt-d": "project_panel::CompareMarkedFiles",
946 "cmd-alt-backspace": ["project_panel::Delete", { "skip_prompt": false }],
947 "cmd-alt-shift-f": "project_panel::NewSearchInDirectory",
948 "shift-down": "menu::SelectNext",
949 "shift-up": "menu::SelectPrevious",
950 "escape": "menu::Cancel"
951 }
952 },
953 {
954 "context": "ProjectPanel && not_editing",
955 "use_key_equivalents": true,
956 "bindings": {
957 "space": "project_panel::Open"
958 }
959 },
960 {
961 "context": "VariableList",
962 "use_key_equivalents": true,
963 "bindings": {
964 "left": "variable_list::CollapseSelectedEntry",
965 "right": "variable_list::ExpandSelectedEntry",
966 "enter": "variable_list::EditVariable",
967 "cmd-c": "variable_list::CopyVariableValue",
968 "cmd-alt-c": "variable_list::CopyVariableName",
969 "delete": "variable_list::RemoveWatch",
970 "backspace": "variable_list::RemoveWatch",
971 "alt-enter": "variable_list::AddWatch"
972 }
973 },
974 {
975 "context": "GitPanel && ChangesList",
976 "use_key_equivalents": true,
977 "bindings": {
978 "up": "menu::SelectPrevious",
979 "down": "menu::SelectNext",
980 "cmd-up": "menu::SelectFirst",
981 "cmd-down": "menu::SelectLast",
982 "enter": "menu::Confirm",
983 "cmd-alt-y": "git::ToggleStaged",
984 "space": "git::ToggleStaged",
985 "shift-space": "git::StageRange",
986 "cmd-y": "git::StageFile",
987 "cmd-shift-y": "git::UnstageFile",
988 "alt-down": "git_panel::FocusEditor",
989 "tab": "git_panel::FocusEditor",
990 "shift-tab": "git_panel::FocusEditor",
991 "escape": "git_panel::ToggleFocus",
992 "backspace": ["git::RestoreFile", { "skip_prompt": false }],
993 "delete": ["git::RestoreFile", { "skip_prompt": false }],
994 "cmd-backspace": ["git::RestoreFile", { "skip_prompt": true }],
995 "cmd-delete": ["git::RestoreFile", { "skip_prompt": true }]
996 }
997 },
998 {
999 "context": "GitPanel && CommitEditor",
1000 "use_key_equivalents": true,
1001 "bindings": {
1002 "escape": "git::Cancel"
1003 }
1004 },
1005 {
1006 "context": "GitDiff > Editor",
1007 "use_key_equivalents": true,
1008 "bindings": {
1009 "cmd-enter": "git::Commit",
1010 "cmd-shift-enter": "git::Amend",
1011 "cmd-ctrl-y": "git::StageAll",
1012 "cmd-ctrl-shift-y": "git::UnstageAll"
1013 }
1014 },
1015 {
1016 "context": "CommitEditor > Editor",
1017 "use_key_equivalents": true,
1018 "bindings": {
1019 "enter": "editor::Newline",
1020 "cmd-enter": "git::Commit",
1021 "cmd-shift-enter": "git::Amend",
1022 "tab": "git_panel::FocusChanges",
1023 "shift-tab": "git_panel::FocusChanges",
1024 "alt-up": "git_panel::FocusChanges",
1025 "shift-escape": "git::ExpandCommitEditor",
1026 "alt-tab": "git::GenerateCommitMessage"
1027 }
1028 },
1029 {
1030 "context": "GitPanel",
1031 "use_key_equivalents": true,
1032 "bindings": {
1033 "ctrl-g ctrl-g": "git::Fetch",
1034 "ctrl-g up": "git::Push",
1035 "ctrl-g down": "git::Pull",
1036 "ctrl-g shift-up": "git::ForcePush",
1037 "ctrl-g d": "git::Diff",
1038 "ctrl-g backspace": "git::RestoreTrackedFiles",
1039 "ctrl-g shift-backspace": "git::TrashUntrackedFiles",
1040 "cmd-ctrl-y": "git::StageAll",
1041 "cmd-ctrl-shift-y": "git::UnstageAll",
1042 "cmd-enter": "git::Commit",
1043 "cmd-shift-enter": "git::Amend"
1044 }
1045 },
1046 {
1047 "context": "GitCommit > Editor",
1048 "use_key_equivalents": true,
1049 "bindings": {
1050 "enter": "editor::Newline",
1051 "escape": "menu::Cancel",
1052 "cmd-enter": "git::Commit",
1053 "cmd-shift-enter": "git::Amend",
1054 "alt-tab": "git::GenerateCommitMessage"
1055 }
1056 },
1057 {
1058 "context": "DebugPanel",
1059 "bindings": {
1060 "cmd-t": "debugger::ToggleThreadPicker",
1061 "cmd-i": "debugger::ToggleSessionPicker",
1062 "shift-alt-escape": "debugger::ToggleExpandItem"
1063 }
1064 },
1065 {
1066 "context": "BreakpointList",
1067 "bindings": {
1068 "space": "debugger::ToggleEnableBreakpoint",
1069 "backspace": "debugger::UnsetBreakpoint",
1070 "left": "debugger::PreviousBreakpointProperty",
1071 "right": "debugger::NextBreakpointProperty"
1072 }
1073 },
1074 {
1075 "context": "CollabPanel && not_editing",
1076 "use_key_equivalents": true,
1077 "bindings": {
1078 "ctrl-backspace": "collab_panel::Remove",
1079 "space": "menu::Confirm"
1080 }
1081 },
1082 {
1083 "context": "CollabPanel",
1084 "use_key_equivalents": true,
1085 "bindings": {
1086 "alt-up": "collab_panel::MoveChannelUp",
1087 "alt-down": "collab_panel::MoveChannelDown"
1088 }
1089 },
1090 {
1091 "context": "(CollabPanel && editing) > Editor",
1092 "use_key_equivalents": true,
1093 "bindings": {
1094 "space": "collab_panel::InsertSpace"
1095 }
1096 },
1097 {
1098 "context": "ChannelModal",
1099 "use_key_equivalents": true,
1100 "bindings": {
1101 "tab": "channel_modal::ToggleMode"
1102 }
1103 },
1104 {
1105 "context": "Picker > Editor",
1106 "use_key_equivalents": true,
1107 "bindings": {
1108 "escape": "menu::Cancel",
1109 "up": "menu::SelectPrevious",
1110 "down": "menu::SelectNext",
1111 "tab": "picker::ConfirmCompletion",
1112 "alt-enter": ["picker::ConfirmInput", { "secondary": false }],
1113 "cmd-alt-enter": ["picker::ConfirmInput", { "secondary": true }]
1114 }
1115 },
1116 {
1117 "context": "ChannelModal > Picker > Editor",
1118 "use_key_equivalents": true,
1119 "bindings": {
1120 "tab": "channel_modal::ToggleMode"
1121 }
1122 },
1123 {
1124 "context": "ToolchainSelector",
1125 "use_key_equivalents": true,
1126 "bindings": {
1127 "cmd-shift-a": "toolchain::AddToolchain"
1128 }
1129 },
1130 {
1131 "context": "FileFinder || (FileFinder > Picker > Editor)",
1132 "use_key_equivalents": true,
1133 "bindings": {
1134 "cmd-shift-a": "file_finder::ToggleSplitMenu",
1135 "cmd-shift-i": "file_finder::ToggleFilterMenu"
1136 }
1137 },
1138 {
1139 "context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)",
1140 "use_key_equivalents": true,
1141 "bindings": {
1142 "cmd-shift-p": "file_finder::SelectPrevious",
1143 "cmd-j": "pane::SplitDown",
1144 "cmd-k": "pane::SplitUp",
1145 "cmd-h": "pane::SplitLeft",
1146 "cmd-l": "pane::SplitRight"
1147 }
1148 },
1149 {
1150 "context": "TabSwitcher",
1151 "use_key_equivalents": true,
1152 "bindings": {
1153 "ctrl-shift-tab": "menu::SelectPrevious",
1154 "ctrl-up": "menu::SelectPrevious",
1155 "ctrl-down": "menu::SelectNext",
1156 "ctrl-backspace": "tab_switcher::CloseSelectedItem"
1157 }
1158 },
1159 {
1160 "context": "StashList || (StashList > Picker > Editor)",
1161 "use_key_equivalents": true,
1162 "bindings": {
1163 "ctrl-shift-backspace": "stash_picker::DropStashItem"
1164 }
1165 },
1166 {
1167 "context": "Terminal",
1168 "use_key_equivalents": true,
1169 "bindings": {
1170 "ctrl-cmd-space": "terminal::ShowCharacterPalette",
1171 "cmd-c": "terminal::Copy",
1172 "cmd-v": "terminal::Paste",
1173 "cmd-f": "buffer_search::Deploy",
1174 "cmd-a": "editor::SelectAll",
1175 "cmd-k": "terminal::Clear",
1176 "cmd-n": "workspace::NewTerminal",
1177 "ctrl-enter": "assistant::InlineAssist",
1178 "ctrl-_": null, // emacs undo
1179 // Some nice conveniences
1180 "cmd-backspace": ["terminal::SendText", "\u0015"], // ctrl-u: clear line
1181 "alt-delete": ["terminal::SendText", "\u001bd"], // alt-d: delete word forward
1182 "cmd-delete": ["terminal::SendText", "\u000b"], // ctrl-k: delete to end of line
1183 "cmd-right": ["terminal::SendText", "\u0005"],
1184 "cmd-left": ["terminal::SendText", "\u0001"],
1185 // Terminal.app compatibility
1186 "alt-left": ["terminal::SendText", "\u001bb"],
1187 "alt-right": ["terminal::SendText", "\u001bf"],
1188 "alt-b": ["terminal::SendText", "\u001bb"],
1189 "alt-f": ["terminal::SendText", "\u001bf"],
1190 "ctrl-delete": ["terminal::SendText", "\u001bd"],
1191 // There are conflicting bindings for these keys in the global context.
1192 // these bindings override them, remove at your own risk:
1193 "up": ["terminal::SendKeystroke", "up"],
1194 "pageup": ["terminal::SendKeystroke", "pageup"],
1195 "down": ["terminal::SendKeystroke", "down"],
1196 "pagedown": ["terminal::SendKeystroke", "pagedown"],
1197 "escape": ["terminal::SendKeystroke", "escape"],
1198 "enter": ["terminal::SendKeystroke", "enter"],
1199 "ctrl-c": ["terminal::SendKeystroke", "ctrl-c"],
1200 "ctrl-backspace": ["terminal::SendKeystroke", "ctrl-w"],
1201 "shift-pageup": "terminal::ScrollPageUp",
1202 "cmd-up": "terminal::ScrollPageUp",
1203 "shift-pagedown": "terminal::ScrollPageDown",
1204 "cmd-down": "terminal::ScrollPageDown",
1205 "shift-up": "terminal::ScrollLineUp",
1206 "shift-down": "terminal::ScrollLineDown",
1207 "shift-home": "terminal::ScrollToTop",
1208 "cmd-home": "terminal::ScrollToTop",
1209 "shift-end": "terminal::ScrollToBottom",
1210 "cmd-end": "terminal::ScrollToBottom",
1211 // Using `ctrl-shift-space` in Zed requires disabling the macOS global shortcut.
1212 // System Preferences->Keyboard->Keyboard Shortcuts->Input Sources->Select the previous input source (uncheck)
1213 "ctrl-shift-space": "terminal::ToggleViMode",
1214 "ctrl-alt-up": "pane::SplitUp",
1215 "ctrl-alt-down": "pane::SplitDown",
1216 "ctrl-alt-left": "pane::SplitLeft",
1217 "ctrl-alt-right": "pane::SplitRight",
1218 "cmd-alt-r": "terminal::RerunTask"
1219 }
1220 },
1221 {
1222 "context": "RateCompletionModal",
1223 "use_key_equivalents": true,
1224 "bindings": {
1225 "cmd-shift-enter": "zeta::ThumbsUpActiveCompletion",
1226 "cmd-shift-backspace": "zeta::ThumbsDownActiveCompletion",
1227 "shift-down": "zeta::NextEdit",
1228 "shift-up": "zeta::PreviousEdit",
1229 "right": "zeta::PreviewCompletion"
1230 }
1231 },
1232 {
1233 "context": "RateCompletionModal > Editor",
1234 "use_key_equivalents": true,
1235 "bindings": {
1236 "escape": "zeta::FocusCompletions",
1237 "cmd-shift-enter": "zeta::ThumbsUpActiveCompletion",
1238 "cmd-shift-backspace": "zeta::ThumbsDownActiveCompletion"
1239 }
1240 },
1241 {
1242 "context": "ZedPredictModal",
1243 "use_key_equivalents": true,
1244 "bindings": {
1245 "escape": "menu::Cancel"
1246 }
1247 },
1248 {
1249 "context": "ConfigureContextServerModal > Editor",
1250 "use_key_equivalents": true,
1251 "bindings": {
1252 "escape": "menu::Cancel",
1253 "enter": "editor::Newline",
1254 "cmd-enter": "menu::Confirm"
1255 }
1256 },
1257 {
1258 "context": "ContextServerToolsModal",
1259 "use_key_equivalents": true,
1260 "bindings": {
1261 "escape": "menu::Cancel"
1262 }
1263 },
1264 {
1265 "context": "OnboardingAiConfigurationModal",
1266 "use_key_equivalents": true,
1267 "bindings": {
1268 "escape": "menu::Cancel"
1269 }
1270 },
1271 {
1272 "context": "Diagnostics",
1273 "use_key_equivalents": true,
1274 "bindings": {
1275 "ctrl-r": "diagnostics::ToggleDiagnosticsRefresh"
1276 }
1277 },
1278 {
1279 "context": "DebugConsole > Editor",
1280 "use_key_equivalents": true,
1281 "bindings": {
1282 "enter": "menu::Confirm",
1283 "alt-enter": "console::WatchExpression"
1284 }
1285 },
1286 {
1287 "context": "RunModal",
1288 "use_key_equivalents": true,
1289 "bindings": {
1290 "ctrl-tab": "pane::ActivateNextItem",
1291 "ctrl-shift-tab": "pane::ActivatePreviousItem"
1292 }
1293 },
1294 {
1295 "context": "MarkdownPreview",
1296 "bindings": {
1297 "pageup": "markdown::MovePageUp",
1298 "pagedown": "markdown::MovePageDown"
1299 }
1300 },
1301 {
1302 "context": "KeymapEditor",
1303 "use_key_equivalents": true,
1304 "bindings": {
1305 "cmd-f": "search::FocusSearch",
1306 "cmd-alt-f": "keymap_editor::ToggleKeystrokeSearch",
1307 "cmd-alt-c": "keymap_editor::ToggleConflictFilter",
1308 "enter": "keymap_editor::EditBinding",
1309 "alt-enter": "keymap_editor::CreateBinding",
1310 "cmd-c": "keymap_editor::CopyAction",
1311 "cmd-shift-c": "keymap_editor::CopyContext",
1312 "cmd-t": "keymap_editor::ShowMatchingKeybinds"
1313 }
1314 },
1315 {
1316 "context": "KeystrokeInput",
1317 "use_key_equivalents": true,
1318 "bindings": {
1319 "enter": "keystroke_input::StartRecording",
1320 "escape escape escape": "keystroke_input::StopRecording",
1321 "delete": "keystroke_input::ClearKeystrokes"
1322 }
1323 },
1324 {
1325 "context": "KeybindEditorModal",
1326 "use_key_equivalents": true,
1327 "bindings": {
1328 "cmd-enter": "menu::Confirm",
1329 "escape": "menu::Cancel"
1330 }
1331 },
1332 {
1333 "context": "KeybindEditorModal > Editor",
1334 "use_key_equivalents": true,
1335 "bindings": {
1336 "up": "menu::SelectPrevious",
1337 "down": "menu::SelectNext"
1338 }
1339 },
1340 {
1341 "context": "Onboarding",
1342 "use_key_equivalents": true,
1343 "bindings": {
1344 "cmd-1": "onboarding::ActivateBasicsPage",
1345 "cmd-2": "onboarding::ActivateEditingPage",
1346 "cmd-3": "onboarding::ActivateAISetupPage",
1347 "cmd-escape": "onboarding::Finish",
1348 "alt-tab": "onboarding::SignIn",
1349 "alt-shift-a": "onboarding::OpenAccount"
1350 }
1351 },
1352 {
1353 "context": "InvalidBuffer",
1354 "use_key_equivalents": true,
1355 "bindings": {
1356 "ctrl-shift-enter": "workspace::OpenWithSystem"
1357 }
1358 }
1359]