default-linux.json

  1[
  2  // Standard Linux bindings
  3  {
  4    "bindings": {
  5      "home": "menu::SelectFirst",
  6      "shift-pageup": "menu::SelectFirst",
  7      "pageup": "menu::SelectFirst",
  8      "end": "menu::SelectLast",
  9      "shift-pagedown": "menu::SelectLast",
 10      "pagedown": "menu::SelectLast",
 11      "ctrl-n": "menu::SelectNext",
 12      "tab": "menu::SelectNext",
 13      "ctrl-p": "menu::SelectPrevious",
 14      "shift-tab": "menu::SelectPrevious",
 15      "enter": "menu::Confirm",
 16      "ctrl-enter": "menu::SecondaryConfirm",
 17      "ctrl-escape": "menu::Cancel",
 18      "ctrl-c": "menu::Cancel",
 19      "escape": "menu::Cancel",
 20      "alt-shift-enter": "menu::Restart",
 21      "alt-enter": ["picker::ConfirmInput", { "secondary": false }],
 22      "ctrl-alt-enter": ["picker::ConfirmInput", { "secondary": true }],
 23      "ctrl-shift-w": "workspace::CloseWindow",
 24      "shift-escape": "workspace::ToggleZoom",
 25      "open": "workspace::Open",
 26      "ctrl-o": "workspace::Open",
 27      "ctrl-=": ["zed::IncreaseBufferFontSize", { "persist": false }],
 28      "ctrl-+": ["zed::IncreaseBufferFontSize", { "persist": false }],
 29      "ctrl--": ["zed::DecreaseBufferFontSize", { "persist": false }],
 30      "ctrl-0": ["zed::ResetBufferFontSize", { "persist": false }],
 31      "ctrl-,": "zed::OpenSettings",
 32      "ctrl-q": "zed::Quit",
 33      "f4": "debugger::Start",
 34      "f5": "debugger::Continue",
 35      "shift-f5": "debugger::Stop",
 36      "f6": "debugger::Pause",
 37      "f7": "debugger::StepOver",
 38      "cmd-f11": "debugger::StepInto",
 39      "shift-f11": "debugger::StepOut",
 40      "f11": "zed::ToggleFullScreen",
 41      "ctrl-alt-z": "edit_prediction::RateCompletions",
 42      "ctrl-shift-i": "edit_prediction::ToggleMenu"
 43    }
 44  },
 45  {
 46    "context": "Picker || menu",
 47    "bindings": {
 48      "up": "menu::SelectPrevious",
 49      "down": "menu::SelectNext"
 50    }
 51  },
 52  {
 53    "context": "Editor",
 54    "bindings": {
 55      "escape": "editor::Cancel",
 56      "shift-backspace": "editor::Backspace",
 57      "backspace": "editor::Backspace",
 58      "delete": "editor::Delete",
 59      "tab": "editor::Tab",
 60      "shift-tab": "editor::Backtab",
 61      "ctrl-k": "editor::CutToEndOfLine",
 62      // "ctrl-t": "editor::Transpose",
 63      "ctrl-k ctrl-q": "editor::Rewrap",
 64      "ctrl-k q": "editor::Rewrap",
 65      "ctrl-backspace": "editor::DeleteToPreviousWordStart",
 66      "ctrl-delete": "editor::DeleteToNextWordEnd",
 67      "cut": "editor::Cut",
 68      "shift-delete": "editor::Cut",
 69      "ctrl-x": "editor::Cut",
 70      "copy": "editor::Copy",
 71      "ctrl-insert": "editor::Copy",
 72      "ctrl-c": "editor::Copy",
 73      "paste": "editor::Paste",
 74      "shift-insert": "editor::Paste",
 75      "ctrl-v": "editor::Paste",
 76      "undo": "editor::Undo",
 77      "ctrl-z": "editor::Undo",
 78      "redo": "editor::Redo",
 79      "ctrl-y": "editor::Redo",
 80      "ctrl-shift-z": "editor::Redo",
 81      "up": "editor::MoveUp",
 82      "ctrl-up": "editor::LineUp",
 83      "ctrl-down": "editor::LineDown",
 84      "pageup": "editor::MovePageUp",
 85      "alt-pageup": "editor::PageUp",
 86      "shift-pageup": "editor::SelectPageUp",
 87      "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
 88      "down": "editor::MoveDown",
 89      "pagedown": "editor::MovePageDown",
 90      "alt-pagedown": "editor::PageDown",
 91      "shift-pagedown": "editor::SelectPageDown",
 92      "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": true }],
 93      "left": "editor::MoveLeft",
 94      "right": "editor::MoveRight",
 95      "ctrl-left": "editor::MoveToPreviousWordStart",
 96      "ctrl-right": "editor::MoveToNextWordEnd",
 97      "ctrl-home": "editor::MoveToBeginning",
 98      "ctrl-end": "editor::MoveToEnd",
 99      "shift-up": "editor::SelectUp",
100      "shift-down": "editor::SelectDown",
101      "shift-left": "editor::SelectLeft",
102      "shift-right": "editor::SelectRight",
103      "ctrl-shift-left": "editor::SelectToPreviousWordStart", // cursorWordLeftSelect
104      "ctrl-shift-right": "editor::SelectToNextWordEnd", // cursorWordRightSelect
105      "ctrl-shift-home": "editor::SelectToBeginning",
106      "ctrl-shift-end": "editor::SelectToEnd",
107      "ctrl-a": "editor::SelectAll",
108      "ctrl-l": "editor::SelectLine",
109      "ctrl-shift-i": "editor::Format",
110      "alt-shift-o": "editor::OrganizeImports",
111      // "cmd-shift-left": ["editor::SelectToBeginningOfLine", {"stop_at_soft_wraps": true, "stop_at_indent": true }],
112      // "ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
113      "shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true, "stop_at_indent": true }],
114      // "cmd-shift-right": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
115      // "ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
116      "shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
117      // "alt-v": ["editor::MovePageUp", { "center_cursor": true }],
118      "ctrl-alt-space": "editor::ShowCharacterPalette",
119      "ctrl-;": "editor::ToggleLineNumbers",
120      "ctrl-'": "editor::ToggleSelectedDiffHunks",
121      "ctrl-\"": "editor::ExpandAllDiffHunks",
122      "ctrl-i": "editor::ShowSignatureHelp",
123      "alt-g b": "editor::ToggleGitBlame",
124      "menu": "editor::OpenContextMenu",
125      "shift-f10": "editor::OpenContextMenu",
126      "ctrl-shift-e": "editor::ToggleEditPrediction",
127      "f9": "editor::ToggleBreakpoint",
128      "shift-f9": "editor::EditLogBreakpoint",
129      "ctrl-shift-backspace": "editor::GoToPreviousChange",
130      "ctrl-shift-alt-backspace": "editor::GoToNextChange"
131    }
132  },
133  {
134    "context": "Editor && mode == full",
135    "bindings": {
136      "shift-enter": "editor::Newline",
137      "enter": "editor::Newline",
138      "ctrl-enter": "editor::NewlineAbove",
139      "ctrl-shift-enter": "editor::NewlineBelow",
140      "ctrl-k ctrl-z": "editor::ToggleSoftWrap",
141      "ctrl-k z": "editor::ToggleSoftWrap",
142      "find": "buffer_search::Deploy",
143      "ctrl-f": "buffer_search::Deploy",
144      "ctrl-h": "buffer_search::DeployReplace",
145      // "cmd-e": ["buffer_search::Deploy", { "focus": false }],
146      "ctrl->": "assistant::QuoteSelection",
147      "ctrl-<": "assistant::InsertIntoEditor",
148      "ctrl-alt-e": "editor::SelectEnclosingSymbol",
149      "alt-enter": "editor::OpenSelectionsInMultibuffer"
150    }
151  },
152  {
153    "context": "Editor && mode == full && edit_prediction",
154    "bindings": {
155      "alt-]": "editor::NextEditPrediction",
156      "alt-[": "editor::PreviousEditPrediction",
157      "alt-right": "editor::AcceptPartialEditPrediction"
158    }
159  },
160  {
161    "context": "Editor && !edit_prediction",
162    "bindings": {
163      "alt-\\": "editor::ShowEditPrediction"
164    }
165  },
166  {
167    "context": "Editor && mode == auto_height",
168    "bindings": {
169      "ctrl-enter": "editor::Newline",
170      "shift-enter": "editor::Newline",
171      "ctrl-shift-enter": "editor::NewlineBelow"
172    }
173  },
174  {
175    "context": "Markdown",
176    "bindings": {
177      "copy": "markdown::Copy",
178      "ctrl-c": "markdown::Copy"
179    }
180  },
181  {
182    "context": "Editor && jupyter && !ContextEditor",
183    "bindings": {
184      "ctrl-shift-enter": "repl::Run",
185      "ctrl-alt-enter": "repl::RunInPlace"
186    }
187  },
188  {
189    "context": "Editor && !agent_diff",
190    "bindings": {
191      "ctrl-k ctrl-r": "git::Restore",
192      "ctrl-alt-y": "git::ToggleStaged",
193      "alt-y": "git::StageAndNext",
194      "alt-shift-y": "git::UnstageAndNext"
195    }
196  },
197  {
198    "context": "Editor && editor_agent_diff",
199    "bindings": {
200      "ctrl-y": "agent::Keep",
201      "ctrl-n": "agent::Reject",
202      "ctrl-shift-y": "agent::KeepAll",
203      "ctrl-shift-n": "agent::RejectAll",
204      "shift-ctrl-r": "agent::OpenAgentDiff"
205    }
206  },
207  {
208    "context": "AgentDiff",
209    "bindings": {
210      "ctrl-y": "agent::Keep",
211      "ctrl-n": "agent::Reject",
212      "ctrl-shift-y": "agent::KeepAll",
213      "ctrl-shift-n": "agent::RejectAll"
214    }
215  },
216  {
217    "context": "ContextEditor > Editor",
218    "bindings": {
219      "ctrl-enter": "assistant::Assist",
220      "ctrl-s": "workspace::Save",
221      "save": "workspace::Save",
222      "ctrl->": "assistant::QuoteSelection",
223      "ctrl-<": "assistant::InsertIntoEditor",
224      "shift-enter": "assistant::Split",
225      "ctrl-r": "assistant::CycleMessageRole",
226      "enter": "assistant::ConfirmCommand",
227      "alt-enter": "editor::Newline",
228      "ctrl-k c": "assistant::CopyCode",
229      "ctrl-g": "search::SelectNextMatch",
230      "ctrl-shift-g": "search::SelectPreviousMatch",
231      "ctrl-k l": "agent::OpenRulesLibrary"
232    }
233  },
234  {
235    "context": "AgentPanel",
236    "bindings": {
237      "ctrl-n": "agent::NewThread",
238      "ctrl-alt-n": "agent::NewTextThread",
239      "ctrl-shift-h": "agent::OpenHistory",
240      "ctrl-alt-c": "agent::OpenConfiguration",
241      "ctrl-alt-p": "agent::OpenRulesLibrary",
242      "ctrl-i": "agent::ToggleProfileSelector",
243      "ctrl-alt-/": "agent::ToggleModelSelector",
244      "ctrl-shift-a": "agent::ToggleContextPicker",
245      "ctrl-shift-o": "agent::ToggleNavigationMenu",
246      "ctrl-shift-i": "agent::ToggleOptionsMenu",
247      "shift-alt-escape": "agent::ExpandMessageEditor",
248      "ctrl-alt-e": "agent::RemoveAllContext",
249      "ctrl-shift-e": "project_panel::ToggleFocus"
250    }
251  },
252  {
253    "context": "AgentPanel > NavigationMenu",
254    "bindings": {
255      "shift-backspace": "agent::DeleteRecentlyOpenThread"
256    }
257  },
258  {
259    "context": "AgentPanel > Markdown",
260    "bindings": {
261      "copy": "markdown::CopyAsMarkdown",
262      "ctrl-c": "markdown::CopyAsMarkdown"
263    }
264  },
265  {
266    "context": "AgentPanel && prompt_editor",
267    "bindings": {
268      "cmd-n": "agent::NewTextThread",
269      "cmd-alt-t": "agent::NewThread"
270    }
271  },
272  {
273    "context": "MessageEditor > Editor",
274    "bindings": {
275      "enter": "agent::Chat",
276      "ctrl-i": "agent::ToggleProfileSelector",
277      "shift-ctrl-r": "agent::OpenAgentDiff"
278    }
279  },
280  {
281    "context": "EditMessageEditor > Editor",
282    "bindings": {
283      "escape": "menu::Cancel",
284      "enter": "menu::Confirm",
285      "alt-enter": "editor::Newline"
286    }
287  },
288  {
289    "context": "AgentFeedbackMessageEditor > Editor",
290    "bindings": {
291      "escape": "menu::Cancel",
292      "enter": "menu::Confirm",
293      "alt-enter": "editor::Newline"
294    }
295  },
296  {
297    "context": "ContextStrip",
298    "bindings": {
299      "up": "agent::FocusUp",
300      "right": "agent::FocusRight",
301      "left": "agent::FocusLeft",
302      "down": "agent::FocusDown",
303      "backspace": "agent::RemoveFocusedContext",
304      "enter": "agent::AcceptSuggestedContext"
305    }
306  },
307  {
308    "context": "ThreadHistory",
309    "bindings": {
310      "backspace": "agent::RemoveSelectedThread"
311    }
312  },
313  {
314    "context": "PromptLibrary",
315    "bindings": {
316      "new": "rules_library::NewRule",
317      "ctrl-n": "rules_library::NewRule",
318      "ctrl-shift-s": "rules_library::ToggleDefaultRule"
319    }
320  },
321  {
322    "context": "BufferSearchBar",
323    "bindings": {
324      "escape": "buffer_search::Dismiss",
325      "tab": "buffer_search::FocusEditor",
326      "enter": "search::SelectNextMatch",
327      "shift-enter": "search::SelectPreviousMatch",
328      "alt-enter": "search::SelectAllMatches",
329      "find": "search::FocusSearch",
330      "ctrl-f": "search::FocusSearch",
331      "ctrl-h": "search::ToggleReplace",
332      "ctrl-l": "search::ToggleSelection"
333    }
334  },
335  {
336    "context": "BufferSearchBar && in_replace > Editor",
337    "bindings": {
338      "enter": "search::ReplaceNext",
339      "ctrl-enter": "search::ReplaceAll"
340    }
341  },
342  {
343    "context": "BufferSearchBar && !in_replace > Editor",
344    "bindings": {
345      "up": "search::PreviousHistoryQuery",
346      "down": "search::NextHistoryQuery"
347    }
348  },
349  {
350    "context": "ProjectSearchBar",
351    "bindings": {
352      "escape": "project_search::ToggleFocus",
353      "shift-find": "search::FocusSearch",
354      "ctrl-shift-f": "search::FocusSearch",
355      "ctrl-shift-h": "search::ToggleReplace",
356      "alt-ctrl-g": "search::ToggleRegex",
357      "alt-ctrl-x": "search::ToggleRegex"
358    }
359  },
360  {
361    "context": "ProjectSearchBar > Editor",
362    "bindings": {
363      "up": "search::PreviousHistoryQuery",
364      "down": "search::NextHistoryQuery"
365    }
366  },
367  {
368    "context": "ProjectSearchBar && in_replace > Editor",
369    "bindings": {
370      "enter": "search::ReplaceNext",
371      "ctrl-alt-enter": "search::ReplaceAll"
372    }
373  },
374  {
375    "context": "ProjectSearchView",
376    "bindings": {
377      "escape": "project_search::ToggleFocus",
378      "ctrl-shift-h": "search::ToggleReplace",
379      "alt-ctrl-g": "search::ToggleRegex",
380      "alt-ctrl-x": "search::ToggleRegex"
381    }
382  },
383  {
384    "context": "Pane",
385    "bindings": {
386      "alt-1": ["pane::ActivateItem", 0],
387      "alt-2": ["pane::ActivateItem", 1],
388      "alt-3": ["pane::ActivateItem", 2],
389      "alt-4": ["pane::ActivateItem", 3],
390      "alt-5": ["pane::ActivateItem", 4],
391      "alt-6": ["pane::ActivateItem", 5],
392      "alt-7": ["pane::ActivateItem", 6],
393      "alt-8": ["pane::ActivateItem", 7],
394      "alt-9": ["pane::ActivateItem", 8],
395      "alt-0": "pane::ActivateLastItem",
396      "ctrl-pageup": "pane::ActivatePreviousItem",
397      "ctrl-pagedown": "pane::ActivateNextItem",
398      "ctrl-shift-pageup": "pane::SwapItemLeft",
399      "ctrl-shift-pagedown": "pane::SwapItemRight",
400      "ctrl-f4": ["pane::CloseActiveItem", { "close_pinned": false }],
401      "ctrl-w": ["pane::CloseActiveItem", { "close_pinned": false }],
402      "alt-ctrl-t": ["pane::CloseInactiveItems", { "close_pinned": false }],
403      "alt-ctrl-shift-w": "workspace::CloseInactiveTabsAndPanes",
404      "ctrl-k e": ["pane::CloseItemsToTheLeft", { "close_pinned": false }],
405      "ctrl-k t": ["pane::CloseItemsToTheRight", { "close_pinned": false }],
406      "ctrl-k u": ["pane::CloseCleanItems", { "close_pinned": false }],
407      "ctrl-k w": ["pane::CloseAllItems", { "close_pinned": false }],
408      "ctrl-k ctrl-w": "workspace::CloseAllItemsAndPanes",
409      "back": "pane::GoBack",
410      "ctrl-alt--": "pane::GoBack",
411      "ctrl-alt-_": "pane::GoForward",
412      "forward": "pane::GoForward",
413      "ctrl-alt-g": "search::SelectNextMatch",
414      "f3": "search::SelectNextMatch",
415      "ctrl-alt-shift-g": "search::SelectPreviousMatch",
416      "shift-f3": "search::SelectPreviousMatch",
417      "shift-find": "project_search::ToggleFocus",
418      "ctrl-shift-f": "project_search::ToggleFocus",
419      "ctrl-alt-shift-h": "search::ToggleReplace",
420      "ctrl-alt-shift-l": "search::ToggleSelection",
421      "alt-enter": "search::SelectAllMatches",
422      "alt-c": "search::ToggleCaseSensitive",
423      "alt-w": "search::ToggleWholeWord",
424      "alt-find": "project_search::ToggleFilters",
425      "alt-ctrl-f": "project_search::ToggleFilters",
426      "ctrl-alt-shift-r": "search::ToggleRegex",
427      "ctrl-alt-shift-x": "search::ToggleRegex",
428      "alt-r": "search::ToggleRegex",
429      "ctrl-k shift-enter": "pane::TogglePinTab"
430    }
431  },
432  // Bindings from VS Code
433  {
434    "context": "Editor",
435    "bindings": {
436      "ctrl-[": "editor::Outdent",
437      "ctrl-]": "editor::Indent",
438      "shift-alt-up": "editor::AddSelectionAbove", // Insert Cursor Above
439      "shift-alt-down": "editor::AddSelectionBelow", // Insert Cursor Below
440      "ctrl-shift-k": "editor::DeleteLine",
441      "alt-up": "editor::MoveLineUp",
442      "alt-down": "editor::MoveLineDown",
443      "ctrl-alt-shift-up": "editor::DuplicateLineUp",
444      "ctrl-alt-shift-down": "editor::DuplicateLineDown",
445      "alt-shift-right": "editor::SelectLargerSyntaxNode", // Expand Selection
446      "alt-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection
447      "ctrl-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection
448      "ctrl-f2": "editor::SelectAllMatches", // Select all occurrences of current word
449      "ctrl-d": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch  / find_under_expand
450      "ctrl-shift-down": ["editor::SelectNext", { "replace_newest": false }], // editor.action.addSelectionToNextFindMatch
451      "ctrl-shift-up": ["editor::SelectPrevious", { "replace_newest": false }], // editor.action.addSelectionToPreviousFindMatch
452      "ctrl-k ctrl-d": ["editor::SelectNext", { "replace_newest": true }], // editor.action.moveSelectionToNextFindMatch  / find_under_expand_skip
453      "ctrl-k ctrl-shift-d": ["editor::SelectPrevious", { "replace_newest": true }], // editor.action.moveSelectionToPreviousFindMatch
454      "ctrl-k ctrl-i": "editor::Hover",
455      "ctrl-/": ["editor::ToggleComments", { "advance_downwards": false }],
456      "ctrl-u": "editor::UndoSelection",
457      "ctrl-shift-u": "editor::RedoSelection",
458      "f8": "editor::GoToDiagnostic",
459      "shift-f8": "editor::GoToPreviousDiagnostic",
460      "f2": "editor::Rename",
461      "f12": "editor::GoToDefinition",
462      "alt-f12": "editor::GoToDefinitionSplit",
463      "ctrl-shift-f10": "editor::GoToDefinitionSplit",
464      "ctrl-f12": "editor::GoToTypeDefinition",
465      "shift-f12": "editor::GoToImplementation",
466      "alt-ctrl-f12": "editor::GoToTypeDefinitionSplit",
467      "alt-shift-f12": "editor::FindAllReferences",
468      "ctrl-m": "editor::MoveToEnclosingBracket",
469      "ctrl-|": "editor::MoveToEnclosingBracket",
470      "ctrl-{": "editor::Fold",
471      "ctrl-}": "editor::UnfoldLines",
472      "ctrl-k ctrl-l": "editor::ToggleFold",
473      "ctrl-k ctrl-[": "editor::FoldRecursive",
474      "ctrl-k ctrl-]": "editor::UnfoldRecursive",
475      "ctrl-k ctrl-1": ["editor::FoldAtLevel", 1],
476      "ctrl-k ctrl-2": ["editor::FoldAtLevel", 2],
477      "ctrl-k ctrl-3": ["editor::FoldAtLevel", 3],
478      "ctrl-k ctrl-4": ["editor::FoldAtLevel", 4],
479      "ctrl-k ctrl-5": ["editor::FoldAtLevel", 5],
480      "ctrl-k ctrl-6": ["editor::FoldAtLevel", 6],
481      "ctrl-k ctrl-7": ["editor::FoldAtLevel", 7],
482      "ctrl-k ctrl-8": ["editor::FoldAtLevel", 8],
483      "ctrl-k ctrl-9": ["editor::FoldAtLevel", 9],
484      "ctrl-k ctrl-0": "editor::FoldAll",
485      "ctrl-k ctrl-j": "editor::UnfoldAll",
486      "ctrl-space": "editor::ShowCompletions",
487      "ctrl-shift-space": "editor::ShowWordCompletions",
488      "ctrl-.": "editor::ToggleCodeActions",
489      "ctrl-k r": "editor::RevealInFileManager",
490      "ctrl-k p": "editor::CopyPath",
491      "ctrl-\\": "pane::SplitRight",
492      "ctrl-k v": "markdown::OpenPreviewToTheSide",
493      "ctrl-shift-v": "markdown::OpenPreview",
494      "ctrl-alt-shift-c": "editor::DisplayCursorNames",
495      "alt-.": "editor::GoToHunk",
496      "alt-,": "editor::GoToPreviousHunk"
497    }
498  },
499  {
500    "context": "Editor && mode == full",
501    "bindings": {
502      "ctrl-shift-o": "outline::Toggle",
503      "ctrl-g": "go_to_line::Toggle"
504    }
505  },
506  {
507    "context": "Workspace",
508    "bindings": {
509      // Change the default action on `menu::Confirm` by setting the parameter
510      // "alt-ctrl-o": ["projects::OpenRecent", { "create_new_window": true }],
511      "alt-open": "projects::OpenRecent",
512      "alt-ctrl-o": "projects::OpenRecent",
513      "alt-shift-open": "projects::OpenRemote",
514      "alt-ctrl-shift-o": "projects::OpenRemote",
515      // Change to open path modal for existing remote connection by setting the parameter
516      // "alt-ctrl-shift-o": "["projects::OpenRemote", { "from_existing_connection": true }]",
517      "alt-ctrl-shift-b": "branches::OpenRecent",
518      "alt-shift-enter": "toast::RunAction",
519      "ctrl-~": "workspace::NewTerminal",
520      "save": "workspace::Save",
521      "ctrl-s": "workspace::Save",
522      "ctrl-k s": "workspace::SaveWithoutFormat",
523      "shift-save": "workspace::SaveAs",
524      "ctrl-shift-s": "workspace::SaveAs",
525      "new": "workspace::NewFile",
526      "ctrl-n": "workspace::NewFile",
527      "shift-new": "workspace::NewWindow",
528      "ctrl-shift-n": "workspace::NewWindow",
529      "ctrl-`": "terminal_panel::ToggleFocus",
530      "f10": ["app_menu::OpenApplicationMenu", "Zed"],
531      "alt-1": ["workspace::ActivatePane", 0],
532      "alt-2": ["workspace::ActivatePane", 1],
533      "alt-3": ["workspace::ActivatePane", 2],
534      "alt-4": ["workspace::ActivatePane", 3],
535      "alt-5": ["workspace::ActivatePane", 4],
536      "alt-6": ["workspace::ActivatePane", 5],
537      "alt-7": ["workspace::ActivatePane", 6],
538      "alt-8": ["workspace::ActivatePane", 7],
539      "alt-9": ["workspace::ActivatePane", 8],
540      "ctrl-alt-b": "workspace::ToggleRightDock",
541      "ctrl-b": "workspace::ToggleLeftDock",
542      "ctrl-j": "workspace::ToggleBottomDock",
543      "ctrl-alt-y": "workspace::CloseAllDocks",
544      "shift-find": "pane::DeploySearch",
545      "ctrl-shift-f": "pane::DeploySearch",
546      "ctrl-shift-h": ["pane::DeploySearch", { "replace_enabled": true }],
547      "ctrl-shift-t": "pane::ReopenClosedItem",
548      "ctrl-k ctrl-s": "zed::OpenKeymap",
549      "ctrl-k ctrl-t": "theme_selector::Toggle",
550      "ctrl-t": "project_symbols::Toggle",
551      "ctrl-p": "file_finder::Toggle",
552      "ctrl-tab": "tab_switcher::Toggle",
553      "ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }],
554      "ctrl-e": "file_finder::Toggle",
555      "f1": "command_palette::Toggle",
556      "ctrl-shift-p": "command_palette::Toggle",
557      "ctrl-shift-m": "diagnostics::Deploy",
558      "ctrl-shift-e": "project_panel::ToggleFocus",
559      "ctrl-shift-b": "outline_panel::ToggleFocus",
560      "ctrl-shift-g": "git_panel::ToggleFocus",
561      "ctrl-?": "agent::ToggleFocus",
562      "alt-save": "workspace::SaveAll",
563      "ctrl-alt-s": "workspace::SaveAll",
564      "ctrl-k m": "language_selector::Toggle",
565      "escape": "workspace::Unfollow",
566      "ctrl-k ctrl-left": "workspace::ActivatePaneLeft",
567      "ctrl-k ctrl-right": "workspace::ActivatePaneRight",
568      "ctrl-k ctrl-up": "workspace::ActivatePaneUp",
569      "ctrl-k ctrl-down": "workspace::ActivatePaneDown",
570      "ctrl-k shift-left": "workspace::SwapPaneLeft",
571      "ctrl-k shift-right": "workspace::SwapPaneRight",
572      "ctrl-k shift-up": "workspace::SwapPaneUp",
573      "ctrl-k shift-down": "workspace::SwapPaneDown",
574      "ctrl-shift-x": "zed::Extensions",
575      "ctrl-shift-r": "task::Rerun",
576      "ctrl-alt-r": "task::Rerun",
577      "alt-t": "task::Rerun",
578      "alt-shift-t": "task::Spawn",
579      "alt-shift-r": ["task::Spawn", { "reveal_target": "center" }]
580      // also possible to spawn tasks by name:
581      // "foo-bar": ["task::Spawn", { "task_name": "MyTask", "reveal_target": "dock" }]
582      // or by tag:
583      // "foo-bar": ["task::Spawn", { "task_tag": "MyTag" }],
584    }
585  },
586  {
587    "context": "ApplicationMenu",
588    "bindings": {
589      "f10": "menu::Cancel",
590      "left": "app_menu::ActivateMenuLeft",
591      "right": "app_menu::ActivateMenuRight"
592    }
593  },
594  // Bindings from Sublime Text
595  {
596    "context": "Editor",
597    "bindings": {
598      "ctrl-shift-d": "editor::DuplicateLineDown",
599      "ctrl-shift-j": "editor::JoinLines",
600      "ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart",
601      "ctrl-alt-h": "editor::DeleteToPreviousSubwordStart",
602      "ctrl-alt-delete": "editor::DeleteToNextSubwordEnd",
603      "ctrl-alt-d": "editor::DeleteToNextSubwordEnd",
604      "ctrl-alt-left": "editor::MoveToPreviousSubwordStart",
605      "ctrl-alt-right": "editor::MoveToNextSubwordEnd",
606      "ctrl-alt-shift-left": "editor::SelectToPreviousSubwordStart",
607      "ctrl-alt-shift-b": "editor::SelectToPreviousSubwordStart",
608      "ctrl-alt-shift-right": "editor::SelectToNextSubwordEnd",
609      "ctrl-alt-shift-f": "editor::SelectToNextSubwordEnd"
610    }
611  },
612  // Bindings from Atom
613  {
614    "context": "Pane",
615    "bindings": {
616      "ctrl-k up": "pane::SplitUp",
617      "ctrl-k down": "pane::SplitDown",
618      "ctrl-k left": "pane::SplitLeft",
619      "ctrl-k right": "pane::SplitRight"
620    }
621  },
622  // Bindings that should be unified with bindings for more general actions
623  {
624    "context": "Editor && renaming",
625    "bindings": {
626      "enter": "editor::ConfirmRename"
627    }
628  },
629  {
630    "context": "Editor && showing_completions",
631    "bindings": {
632      "enter": "editor::ConfirmCompletion",
633      "shift-enter": "editor::ConfirmCompletionReplace",
634      "tab": "editor::ComposeCompletion"
635    }
636  },
637  // Bindings for accepting edit predictions
638  //
639  // alt-l is provided as an alternative to tab/alt-tab. and will be displayed in the UI. This is
640  // because alt-tab may not be available, as it is often used for window switching.
641  {
642    "context": "Editor && edit_prediction",
643    "bindings": {
644      "alt-tab": "editor::AcceptEditPrediction",
645      "alt-l": "editor::AcceptEditPrediction",
646      "tab": "editor::AcceptEditPrediction"
647    }
648  },
649  {
650    "context": "Editor && edit_prediction_conflict",
651    "bindings": {
652      "alt-tab": "editor::AcceptEditPrediction",
653      "alt-l": "editor::AcceptEditPrediction"
654    }
655  },
656  {
657    "context": "Editor && showing_code_actions",
658    "bindings": {
659      "enter": "editor::ConfirmCodeAction"
660    }
661  },
662  {
663    "context": "Editor && (showing_code_actions || showing_completions)",
664    "bindings": {
665      "ctrl-p": "editor::ContextMenuPrevious",
666      "up": "editor::ContextMenuPrevious",
667      "ctrl-n": "editor::ContextMenuNext",
668      "down": "editor::ContextMenuNext",
669      "pageup": "editor::ContextMenuFirst",
670      "pagedown": "editor::ContextMenuLast"
671    }
672  },
673  // Custom bindings
674  {
675    "bindings": {
676      "ctrl-alt-shift-f": "workspace::FollowNextCollaborator",
677      "ctrl-alt-i": "zed::DebugElements"
678    }
679  },
680  {
681    "context": "!Terminal",
682    "bindings": {
683      "ctrl-shift-c": "collab_panel::ToggleFocus"
684    }
685  },
686  {
687    "context": "!ContextEditor > Editor && mode == full",
688    "bindings": {
689      "alt-enter": "editor::OpenExcerpts",
690      "shift-enter": "editor::ExpandExcerpts",
691      "ctrl-alt-enter": "editor::OpenExcerptsSplit",
692      "ctrl-shift-e": "pane::RevealInProjectPanel",
693      "ctrl-f8": "editor::GoToHunk",
694      "ctrl-shift-f8": "editor::GoToPreviousHunk",
695      "ctrl-enter": "assistant::InlineAssist",
696      "ctrl-:": "editor::ToggleInlayHints"
697    }
698  },
699  {
700    "context": "PromptEditor",
701    "bindings": {
702      "ctrl-[": "agent::CyclePreviousInlineAssist",
703      "ctrl-]": "agent::CycleNextInlineAssist",
704      "ctrl-alt-e": "agent::RemoveAllContext"
705    }
706  },
707  {
708    "context": "Prompt",
709    "bindings": {
710      "left": "menu::SelectPrevious",
711      "right": "menu::SelectNext",
712      "h": "menu::SelectPrevious",
713      "l": "menu::SelectNext"
714    }
715  },
716  {
717    "context": "ProjectSearchBar && !in_replace",
718    "bindings": {
719      "ctrl-enter": "project_search::SearchInNew"
720    }
721  },
722  {
723    "context": "OutlinePanel && not_editing",
724    "bindings": {
725      "escape": "menu::Cancel",
726      "left": "outline_panel::CollapseSelectedEntry",
727      "right": "outline_panel::ExpandSelectedEntry",
728      "alt-copy": "outline_panel::CopyPath",
729      "ctrl-alt-c": "outline_panel::CopyPath",
730      "alt-shift-copy": "workspace::CopyRelativePath",
731      "alt-ctrl-shift-c": "workspace::CopyRelativePath",
732      "alt-ctrl-r": "outline_panel::RevealInFileManager",
733      "space": "outline_panel::OpenSelectedEntry",
734      "shift-down": "menu::SelectNext",
735      "shift-up": "menu::SelectPrevious",
736      "alt-enter": "editor::OpenExcerpts",
737      "ctrl-alt-enter": "editor::OpenExcerptsSplit"
738    }
739  },
740  {
741    "context": "ProjectPanel",
742    "bindings": {
743      "left": "project_panel::CollapseSelectedEntry",
744      "right": "project_panel::ExpandSelectedEntry",
745      "new": "project_panel::NewFile",
746      "ctrl-n": "project_panel::NewFile",
747      "alt-new": "project_panel::NewDirectory",
748      "alt-ctrl-n": "project_panel::NewDirectory",
749      "cut": "project_panel::Cut",
750      "ctrl-x": "project_panel::Cut",
751      "copy": "project_panel::Copy",
752      "ctrl-insert": "project_panel::Copy",
753      "ctrl-c": "project_panel::Copy",
754      "paste": "project_panel::Paste",
755      "shift-insert": "project_panel::Paste",
756      "ctrl-v": "project_panel::Paste",
757      "alt-copy": "project_panel::CopyPath",
758      "ctrl-alt-c": "project_panel::CopyPath",
759      "alt-shift-copy": "workspace::CopyRelativePath",
760      "alt-ctrl-shift-c": "workspace::CopyRelativePath",
761      "enter": "project_panel::Rename",
762      "f2": "project_panel::Rename",
763      "backspace": ["project_panel::Trash", { "skip_prompt": false }],
764      "delete": ["project_panel::Trash", { "skip_prompt": false }],
765      "shift-delete": ["project_panel::Delete", { "skip_prompt": false }],
766      "ctrl-backspace": ["project_panel::Delete", { "skip_prompt": false }],
767      "ctrl-delete": ["project_panel::Delete", { "skip_prompt": false }],
768      "alt-ctrl-r": "project_panel::RevealInFileManager",
769      "ctrl-shift-enter": "project_panel::OpenWithSystem",
770      "shift-find": "project_panel::NewSearchInDirectory",
771      "ctrl-alt-shift-f": "project_panel::NewSearchInDirectory",
772      "shift-down": "menu::SelectNext",
773      "shift-up": "menu::SelectPrevious",
774      "escape": "menu::Cancel"
775    }
776  },
777  {
778    "context": "ProjectPanel && not_editing",
779    "bindings": {
780      "space": "project_panel::Open"
781    }
782  },
783  {
784    "context": "GitPanel && ChangesList",
785    "bindings": {
786      "up": "menu::SelectPrevious",
787      "down": "menu::SelectNext",
788      "enter": "menu::Confirm",
789      "alt-y": "git::StageFile",
790      "alt-shift-y": "git::UnstageFile",
791      "ctrl-alt-y": "git::ToggleStaged",
792      "space": "git::ToggleStaged",
793      "tab": "git_panel::FocusEditor",
794      "shift-tab": "git_panel::FocusEditor",
795      "escape": "git_panel::ToggleFocus",
796      "ctrl-enter": "git::Commit",
797      "ctrl-shift-enter": "git::Amend",
798      "alt-enter": "menu::SecondaryConfirm",
799      "delete": ["git::RestoreFile", { "skip_prompt": false }],
800      "backspace": ["git::RestoreFile", { "skip_prompt": false }],
801      "shift-delete": ["git::RestoreFile", { "skip_prompt": false }],
802      "ctrl-backspace": ["git::RestoreFile", { "skip_prompt": false }],
803      "ctrl-delete": ["git::RestoreFile", { "skip_prompt": false }]
804    }
805  },
806  {
807    "context": "GitPanel && CommitEditor",
808    "use_key_equivalents": true,
809    "bindings": {
810      "escape": "git::Cancel"
811    }
812  },
813  {
814    "context": "GitCommit > Editor",
815    "bindings": {
816      "escape": "menu::Cancel",
817      "enter": "editor::Newline",
818      "ctrl-enter": "git::Commit",
819      "ctrl-shift-enter": "git::Amend",
820      "alt-l": "git::GenerateCommitMessage"
821    }
822  },
823  {
824    "context": "GitPanel",
825    "bindings": {
826      "ctrl-g ctrl-g": "git::Fetch",
827      "ctrl-g up": "git::Push",
828      "ctrl-g down": "git::Pull",
829      "ctrl-g shift-up": "git::ForcePush",
830      "ctrl-g d": "git::Diff",
831      "ctrl-g backspace": "git::RestoreTrackedFiles",
832      "ctrl-g shift-backspace": "git::TrashUntrackedFiles",
833      "ctrl-space": "git::StageAll",
834      "ctrl-shift-space": "git::UnstageAll"
835    }
836  },
837  {
838    "context": "GitDiff > Editor",
839    "bindings": {
840      "ctrl-enter": "git::Commit",
841      "ctrl-shift-enter": "git::Amend",
842      "ctrl-space": "git::StageAll",
843      "ctrl-shift-space": "git::UnstageAll"
844    }
845  },
846  {
847    "context": "AskPass > Editor",
848    "bindings": {
849      "enter": "menu::Confirm"
850    }
851  },
852  {
853    "context": "GitPanel > Editor",
854    "bindings": {
855      "escape": "git_panel::FocusChanges",
856      "tab": "git_panel::FocusChanges",
857      "shift-tab": "git_panel::FocusChanges",
858      "enter": "editor::Newline",
859      "ctrl-enter": "git::Commit",
860      "ctrl-shift-enter": "git::Amend",
861      "alt-up": "git_panel::FocusChanges",
862      "alt-l": "git::GenerateCommitMessage"
863    }
864  },
865  {
866    "context": "CollabPanel && not_editing",
867    "bindings": {
868      "ctrl-backspace": "collab_panel::Remove",
869      "space": "menu::Confirm"
870    }
871  },
872  {
873    "context": "(CollabPanel && editing) > Editor",
874    "bindings": {
875      "space": "collab_panel::InsertSpace"
876    }
877  },
878  {
879    "context": "ChannelModal",
880    "bindings": {
881      "tab": "channel_modal::ToggleMode"
882    }
883  },
884  {
885    "context": "Picker > Editor",
886    "bindings": {
887      "escape": "menu::Cancel",
888      "up": "menu::SelectPrevious",
889      "down": "menu::SelectNext",
890      "tab": "picker::ConfirmCompletion",
891      "alt-enter": ["picker::ConfirmInput", { "secondary": false }]
892    }
893  },
894  {
895    "context": "ChannelModal > Picker > Editor",
896    "bindings": {
897      "tab": "channel_modal::ToggleMode"
898    }
899  },
900  {
901    "context": "FileFinder || (FileFinder > Picker > Editor) || (FileFinder > Picker > menu)",
902    "bindings": {
903      "ctrl-shift-p": "file_finder::SelectPrevious",
904      "ctrl-j": "pane::SplitDown",
905      "ctrl-k": "pane::SplitUp",
906      "ctrl-h": "pane::SplitLeft",
907      "ctrl-l": "pane::SplitRight"
908    }
909  },
910  {
911    "context": "TabSwitcher",
912    "bindings": {
913      "ctrl-shift-tab": "menu::SelectPrevious",
914      "ctrl-up": "menu::SelectPrevious",
915      "ctrl-down": "menu::SelectNext",
916      "ctrl-backspace": "tab_switcher::CloseSelectedItem"
917    }
918  },
919  {
920    "context": "Terminal",
921    "bindings": {
922      "ctrl-alt-space": "terminal::ShowCharacterPalette",
923      "copy": "terminal::Copy",
924      "ctrl-insert": "terminal::Copy",
925      "ctrl-shift-c": "terminal::Copy",
926      "paste": "terminal::Paste",
927      "shift-insert": "terminal::Paste",
928      "ctrl-shift-v": "terminal::Paste",
929      "ctrl-enter": "assistant::InlineAssist",
930      "alt-b": ["terminal::SendText", "\u001bb"],
931      "alt-f": ["terminal::SendText", "\u001bf"],
932      "alt-.": ["terminal::SendText", "\u001b."],
933      "ctrl-delete": ["terminal::SendText", "\u001bd"],
934      // Overrides for conflicting keybindings
935      "ctrl-b": ["terminal::SendKeystroke", "ctrl-b"],
936      "ctrl-c": ["terminal::SendKeystroke", "ctrl-c"],
937      "ctrl-e": ["terminal::SendKeystroke", "ctrl-e"],
938      "ctrl-o": ["terminal::SendKeystroke", "ctrl-o"],
939      "ctrl-w": ["terminal::SendKeystroke", "ctrl-w"],
940      "ctrl-backspace": ["terminal::SendKeystroke", "ctrl-w"],
941      "ctrl-shift-a": "editor::SelectAll",
942      "find": "buffer_search::Deploy",
943      "ctrl-shift-f": "buffer_search::Deploy",
944      "ctrl-shift-l": "terminal::Clear",
945      "ctrl-shift-w": "pane::CloseActiveItem",
946      "up": ["terminal::SendKeystroke", "up"],
947      "pageup": ["terminal::SendKeystroke", "pageup"],
948      "down": ["terminal::SendKeystroke", "down"],
949      "pagedown": ["terminal::SendKeystroke", "pagedown"],
950      "escape": ["terminal::SendKeystroke", "escape"],
951      "enter": ["terminal::SendKeystroke", "enter"],
952      "shift-pageup": "terminal::ScrollPageUp",
953      "shift-pagedown": "terminal::ScrollPageDown",
954      "shift-up": "terminal::ScrollLineUp",
955      "shift-down": "terminal::ScrollLineDown",
956      "shift-home": "terminal::ScrollToTop",
957      "shift-end": "terminal::ScrollToBottom",
958      "ctrl-shift-space": "terminal::ToggleViMode",
959      "ctrl-shift-r": "terminal::RerunTask",
960      "ctrl-alt-r": "terminal::RerunTask",
961      "alt-t": "terminal::RerunTask"
962    }
963  },
964  {
965    "context": "ZedPredictModal",
966    "bindings": {
967      "escape": "menu::Cancel"
968    }
969  },
970  {
971    "context": "ConfigureContextServerModal > Editor",
972    "bindings": {
973      "escape": "menu::Cancel",
974      "enter": "editor::Newline",
975      "ctrl-enter": "menu::Confirm"
976    }
977  },
978  {
979    "context": "Diagnostics",
980    "use_key_equivalents": true,
981    "bindings": {
982      "ctrl-r": "diagnostics::ToggleDiagnosticsRefresh"
983    }
984  },
985  {
986    "context": "DebugConsole > Editor",
987    "use_key_equivalents": true,
988    "bindings": {
989      "enter": "menu::Confirm"
990    }
991  }
992]