mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 03:25:59 +00:00
28271a9a36
Prototypes a way to display new entities in the outline panel, making it less outline. The design is not final and might be adjusted, but the workflow seems to be solid enough to keep and iron it out. * Now, when any project search buffer is activated (multi buffer mode), or buffer search is open (singleton buffer mode, but is available for search usages multi buffer too — in that case buffer search overrides multi buffer's contents display), outline panel displays all search matches instead of the outline items. Outline items are not displayed at all during those cases, unless the buffer search is closed, or a new buffer gets opened, of an active buffer search matches zero items. https://github.com/user-attachments/assets/4a3e4faa-7f75-4522-96bb-3761872c753a * For the multi buffer mode, search matches are grouped under directories and files, same as outline items ![Screenshot 2024-08-21 at 14 55 01](https://github.com/user-attachments/assets/6dac75e4-be4e-4338-917b-37a32c285b71) * For buffer search , search matches are displayed one under another ![image](https://github.com/user-attachments/assets/9efcff85-d4c7-4462-9ef5-f76b08e59f20) For both cases, the entire match line is taken and rendered, with the hover tooltip showing the line number. So far it does not look very bad, but I am certain there are bad cases with long lines and bad indents where it looks not optimal — this part most probably will be redesigned after some trial. Or, maybe, it's ok to leave the current state if the horizontal scrollbar is added? Clicking the item navigates to the item's position in the editor. Search item lines are also possible to filter with the outline panel's filter input. * Inline panel is now possible to "pin" to track a currently active editor, to display outlines/search results for that editor even if another item is activated afterwards: ![image](https://github.com/user-attachments/assets/75fb78c3-0e5f-47b4-ba3a-485c71d7e342) This is useful in combination with project search results display: now it's possible to leave the search results pinned in the outline panel and jump to every search result and back. If the item the panel was pinned to gets closed, the panel gets back to its regular state, showing outlines/search results for a currently active editor. Release Notes: - Added a way to display buffer/project search entries in the outline panel
661 lines
24 KiB
JSON
661 lines
24 KiB
JSON
[
|
|
// Standard macOS bindings
|
|
{
|
|
"bindings": {
|
|
"up": "menu::SelectPrev",
|
|
"shift-tab": "menu::SelectPrev",
|
|
"home": "menu::SelectFirst",
|
|
"pageup": "menu::SelectFirst",
|
|
"shift-pageup": "menu::SelectFirst",
|
|
"ctrl-p": "menu::SelectPrev",
|
|
"down": "menu::SelectNext",
|
|
"tab": "menu::SelectNext",
|
|
"end": "menu::SelectLast",
|
|
"pagedown": "menu::SelectLast",
|
|
"shift-pagedown": "menu::SelectFirst",
|
|
"ctrl-n": "menu::SelectNext",
|
|
"cmd-up": "menu::SelectFirst",
|
|
"cmd-down": "menu::SelectLast",
|
|
"enter": "menu::Confirm",
|
|
"ctrl-enter": "menu::SecondaryConfirm",
|
|
"cmd-enter": "menu::SecondaryConfirm",
|
|
"escape": "menu::Cancel",
|
|
"cmd-escape": "menu::Cancel",
|
|
"ctrl-escape": "menu::Cancel",
|
|
"ctrl-c": "menu::Cancel",
|
|
"cmd-shift-w": "workspace::CloseWindow",
|
|
"shift-escape": "workspace::ToggleZoom",
|
|
"cmd-o": "workspace::Open",
|
|
"cmd-=": "zed::IncreaseBufferFontSize",
|
|
"cmd-+": "zed::IncreaseBufferFontSize",
|
|
"cmd--": "zed::DecreaseBufferFontSize",
|
|
"cmd-0": "zed::ResetBufferFontSize",
|
|
"cmd-,": "zed::OpenSettings",
|
|
"cmd-q": "zed::Quit",
|
|
"cmd-h": "zed::Hide",
|
|
"alt-cmd-h": "zed::HideOthers",
|
|
"cmd-m": "zed::Minimize",
|
|
"ctrl-cmd-f": "zed::ToggleFullScreen"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor",
|
|
"bindings": {
|
|
"escape": "editor::Cancel",
|
|
"backspace": "editor::Backspace",
|
|
"shift-backspace": "editor::Backspace",
|
|
"ctrl-h": "editor::Backspace",
|
|
"delete": "editor::Delete",
|
|
"ctrl-d": "editor::Delete",
|
|
"tab": "editor::Tab",
|
|
"shift-tab": "editor::TabPrev",
|
|
"ctrl-k": "editor::CutToEndOfLine",
|
|
"ctrl-t": "editor::Transpose",
|
|
"cmd-backspace": "editor::DeleteToBeginningOfLine",
|
|
"cmd-delete": "editor::DeleteToEndOfLine",
|
|
"alt-backspace": "editor::DeleteToPreviousWordStart",
|
|
"ctrl-w": "editor::DeleteToPreviousWordStart",
|
|
"alt-delete": "editor::DeleteToNextWordEnd",
|
|
"alt-h": "editor::DeleteToPreviousWordStart",
|
|
"alt-d": "editor::DeleteToNextWordEnd",
|
|
"cmd-x": "editor::Cut",
|
|
"cmd-c": "editor::Copy",
|
|
"cmd-v": "editor::Paste",
|
|
"cmd-z": "editor::Undo",
|
|
"cmd-shift-z": "editor::Redo",
|
|
"up": "editor::MoveUp",
|
|
"ctrl-up": "editor::MoveToStartOfParagraph",
|
|
"pageup": "editor::MovePageUp",
|
|
"shift-pageup": "editor::SelectPageUp",
|
|
"cmd-pageup": "editor::PageUp",
|
|
"ctrl-pageup": "editor::LineUp",
|
|
"home": "editor::MoveToBeginningOfLine",
|
|
"down": "editor::MoveDown",
|
|
"ctrl-down": "editor::MoveToEndOfParagraph",
|
|
"pagedown": "editor::MovePageDown",
|
|
"shift-pagedown": "editor::SelectPageDown",
|
|
"cmd-pagedown": "editor::PageDown",
|
|
"ctrl-pagedown": "editor::LineDown",
|
|
"end": "editor::MoveToEndOfLine",
|
|
"left": "editor::MoveLeft",
|
|
"right": "editor::MoveRight",
|
|
"ctrl-p": "editor::MoveUp",
|
|
"ctrl-n": "editor::MoveDown",
|
|
"ctrl-b": "editor::MoveLeft",
|
|
"ctrl-f": "editor::MoveRight",
|
|
"ctrl-l": "editor::ScrollCursorCenter",
|
|
"alt-left": "editor::MoveToPreviousWordStart",
|
|
"alt-b": "editor::MoveToPreviousWordStart",
|
|
"alt-right": "editor::MoveToNextWordEnd",
|
|
"alt-f": "editor::MoveToNextWordEnd",
|
|
"cmd-left": "editor::MoveToBeginningOfLine",
|
|
"ctrl-a": "editor::MoveToBeginningOfLine",
|
|
"cmd-right": "editor::MoveToEndOfLine",
|
|
"ctrl-e": "editor::MoveToEndOfLine",
|
|
"cmd-up": "editor::MoveToBeginning",
|
|
"cmd-down": "editor::MoveToEnd",
|
|
"shift-up": "editor::SelectUp",
|
|
"ctrl-shift-p": "editor::SelectUp",
|
|
"shift-down": "editor::SelectDown",
|
|
"ctrl-shift-n": "editor::SelectDown",
|
|
"shift-left": "editor::SelectLeft",
|
|
"ctrl-shift-b": "editor::SelectLeft",
|
|
"shift-right": "editor::SelectRight",
|
|
"ctrl-shift-f": "editor::SelectRight",
|
|
"alt-shift-left": "editor::SelectToPreviousWordStart", // cursorWordLeftSelect
|
|
"alt-shift-b": "editor::SelectToPreviousWordStart",
|
|
"alt-shift-right": "editor::SelectToNextWordEnd", // cursorWordRightSelect
|
|
"alt-shift-f": "editor::SelectToNextWordEnd",
|
|
"ctrl-shift-up": "editor::SelectToStartOfParagraph",
|
|
"ctrl-shift-down": "editor::SelectToEndOfParagraph",
|
|
"cmd-shift-up": "editor::SelectToBeginning",
|
|
"cmd-shift-down": "editor::SelectToEnd",
|
|
"cmd-a": "editor::SelectAll",
|
|
"cmd-l": "editor::SelectLine",
|
|
"cmd-shift-i": "editor::Format",
|
|
"cmd-shift-left": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true }],
|
|
"shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true }],
|
|
"ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true }],
|
|
"cmd-shift-right": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
|
|
"shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
|
|
"ctrl-shift-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": true }],
|
|
"ctrl-v": ["editor::MovePageDown", { "center_cursor": true }],
|
|
"alt-v": ["editor::MovePageUp", { "center_cursor": true }],
|
|
"ctrl-cmd-space": "editor::ShowCharacterPalette",
|
|
"cmd-;": "editor::ToggleLineNumbers",
|
|
"cmd-alt-z": "editor::RevertSelectedHunks",
|
|
"cmd-'": "editor::ToggleHunkDiff",
|
|
"cmd-\"": "editor::ExpandAllHunkDiffs",
|
|
"cmd-alt-g b": "editor::ToggleGitBlame",
|
|
"cmd-i": "editor::ShowSignatureHelp",
|
|
"ctrl-f12": "editor::GoToDeclaration",
|
|
"alt-ctrl-f12": "editor::GoToDeclarationSplit"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && mode == full",
|
|
"bindings": {
|
|
"enter": "editor::Newline",
|
|
"shift-enter": "editor::Newline",
|
|
"cmd-enter": "editor::NewlineBelow",
|
|
"cmd-shift-enter": "editor::NewlineAbove",
|
|
"alt-z": "editor::ToggleSoftWrap",
|
|
"cmd-f": "buffer_search::Deploy",
|
|
"cmd-alt-f": ["buffer_search::Deploy", { "replace_enabled": true }],
|
|
"cmd-alt-l": ["buffer_search::Deploy", { "selection_search_enabled": true }],
|
|
"cmd-e": ["buffer_search::Deploy", { "focus": false }],
|
|
"cmd->": "assistant::QuoteSelection",
|
|
"cmd-<": "assistant::InsertIntoEditor",
|
|
"cmd-alt-e": "editor::SelectEnclosingSymbol"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && mode == full && inline_completion",
|
|
"bindings": {
|
|
"alt-]": "editor::NextInlineCompletion",
|
|
"alt-[": "editor::PreviousInlineCompletion",
|
|
"cmd-right": "editor::AcceptPartialInlineCompletion"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && !inline_completion",
|
|
"bindings": {
|
|
"alt-\\": "editor::ShowInlineCompletion"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && mode == auto_height",
|
|
"bindings": {
|
|
"ctrl-enter": "editor::Newline",
|
|
"shift-enter": "editor::Newline",
|
|
"ctrl-shift-enter": "editor::NewlineBelow"
|
|
}
|
|
},
|
|
{
|
|
"context": "Markdown",
|
|
"bindings": {
|
|
"cmd-c": "markdown::Copy"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && jupyter && !ContextEditor",
|
|
"bindings": {
|
|
"ctrl-shift-enter": "repl::Run",
|
|
"ctrl-alt-enter": "repl::RunInPlace"
|
|
}
|
|
},
|
|
{
|
|
"context": "AssistantPanel",
|
|
"bindings": {
|
|
"cmd-g": "search::SelectNextMatch",
|
|
"cmd-shift-g": "search::SelectPrevMatch",
|
|
"alt-m": "assistant::ToggleModelSelector",
|
|
"cmd-k h": "assistant::DeployHistory",
|
|
"cmd-k l": "assistant::DeployPromptLibrary"
|
|
}
|
|
},
|
|
{
|
|
"context": "ContextEditor > Editor",
|
|
"bindings": {
|
|
"cmd-enter": "assistant::Assist",
|
|
"cmd-s": "workspace::Save",
|
|
"cmd->": "assistant::QuoteSelection",
|
|
"cmd-<": "assistant::InsertIntoEditor",
|
|
"shift-enter": "assistant::Split",
|
|
"ctrl-r": "assistant::CycleMessageRole",
|
|
"enter": "assistant::ConfirmCommand",
|
|
"alt-enter": "editor::Newline"
|
|
}
|
|
},
|
|
{
|
|
"context": "PromptLibrary",
|
|
"bindings": {
|
|
"cmd-n": "prompt_library::NewPrompt",
|
|
"cmd-shift-s": "prompt_library::ToggleDefaultPrompt",
|
|
"cmd-w": "workspace::CloseWindow"
|
|
}
|
|
},
|
|
{
|
|
"context": "BufferSearchBar",
|
|
"bindings": {
|
|
"escape": "buffer_search::Dismiss",
|
|
"tab": "buffer_search::FocusEditor",
|
|
"enter": "search::SelectNextMatch",
|
|
"shift-enter": "search::SelectPrevMatch",
|
|
"alt-enter": "search::SelectAllMatches",
|
|
"cmd-f": "search::FocusSearch",
|
|
"cmd-alt-f": "search::ToggleReplace",
|
|
"cmd-alt-l": "search::ToggleSelection"
|
|
}
|
|
},
|
|
{
|
|
"context": "BufferSearchBar && in_replace",
|
|
"bindings": {
|
|
"enter": "search::ReplaceNext",
|
|
"cmd-enter": "search::ReplaceAll"
|
|
}
|
|
},
|
|
{
|
|
"context": "BufferSearchBar && !in_replace > Editor",
|
|
"bindings": {
|
|
"up": "search::PreviousHistoryQuery",
|
|
"down": "search::NextHistoryQuery"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectSearchBar",
|
|
"bindings": {
|
|
"escape": "project_search::ToggleFocus",
|
|
"cmd-shift-j": "project_search::ToggleFilters",
|
|
"cmd-shift-f": "search::FocusSearch",
|
|
"cmd-shift-h": "search::ToggleReplace",
|
|
"alt-cmd-g": "search::ToggleRegex",
|
|
"alt-cmd-x": "search::ToggleRegex"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectSearchBar > Editor",
|
|
"bindings": {
|
|
"up": "search::PreviousHistoryQuery",
|
|
"down": "search::NextHistoryQuery"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectSearchBar && in_replace > Editor",
|
|
"bindings": {
|
|
"enter": "search::ReplaceNext",
|
|
"cmd-enter": "search::ReplaceAll"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectSearchView",
|
|
"bindings": {
|
|
"escape": "project_search::ToggleFocus",
|
|
"cmd-shift-j": "project_search::ToggleFilters",
|
|
"cmd-shift-h": "search::ToggleReplace",
|
|
"alt-cmd-g": "search::ToggleRegex",
|
|
"alt-cmd-x": "search::ToggleRegex"
|
|
}
|
|
},
|
|
{
|
|
"context": "Pane",
|
|
"bindings": {
|
|
"cmd-{": "pane::ActivatePrevItem",
|
|
"cmd-}": "pane::ActivateNextItem",
|
|
"alt-cmd-left": "pane::ActivatePrevItem",
|
|
"alt-cmd-right": "pane::ActivateNextItem",
|
|
"cmd-w": "pane::CloseActiveItem",
|
|
"alt-cmd-t": "pane::CloseInactiveItems",
|
|
"ctrl-alt-cmd-w": "workspace::CloseInactiveTabsAndPanes",
|
|
"cmd-k u": "pane::CloseCleanItems",
|
|
"cmd-k cmd-w": "pane::CloseAllItems",
|
|
"cmd-f": "project_search::ToggleFocus",
|
|
"cmd-g": "search::SelectNextMatch",
|
|
"cmd-shift-g": "search::SelectPrevMatch",
|
|
"cmd-shift-h": "search::ToggleReplace",
|
|
"cmd-alt-l": "search::ToggleSelection",
|
|
"alt-enter": "search::SelectAllMatches",
|
|
"alt-cmd-c": "search::ToggleCaseSensitive",
|
|
"alt-cmd-w": "search::ToggleWholeWord",
|
|
"alt-cmd-f": "project_search::ToggleFilters",
|
|
"alt-cmd-x": "search::ToggleRegex"
|
|
}
|
|
},
|
|
// Bindings from VS Code
|
|
{
|
|
"context": "Editor",
|
|
"bindings": {
|
|
"cmd-[": "editor::Outdent",
|
|
"cmd-]": "editor::Indent",
|
|
"cmd-alt-up": "editor::AddSelectionAbove", // Insert cursor above
|
|
"cmd-ctrl-p": "editor::AddSelectionAbove",
|
|
"cmd-alt-down": "editor::AddSelectionBelow", // Insert cursor below
|
|
"cmd-ctrl-n": "editor::AddSelectionBelow",
|
|
"cmd-shift-k": "editor::DeleteLine",
|
|
"alt-up": "editor::MoveLineUp",
|
|
"alt-down": "editor::MoveLineDown",
|
|
"alt-shift-up": "editor::DuplicateLineUp",
|
|
"alt-shift-down": "editor::DuplicateLineDown",
|
|
"ctrl-shift-right": "editor::SelectLargerSyntaxNode", // Expand Selection
|
|
"ctrl-shift-left": "editor::SelectSmallerSyntaxNode", // Shrink Selection
|
|
"cmd-d": ["editor::SelectNext", { "replace_newest": false }], // Add selection to Next Find Match
|
|
"cmd-shift-l": "editor::SelectAllMatches", // Select all occurrences of current selection
|
|
"cmd-f2": "editor::SelectAllMatches", // Select all occurrences of current word
|
|
"ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": false }],
|
|
"cmd-k cmd-d": ["editor::SelectNext", { "replace_newest": true }],
|
|
"cmd-k ctrl-cmd-d": ["editor::SelectPrevious", { "replace_newest": true }],
|
|
"cmd-k cmd-i": "editor::Hover",
|
|
"cmd-/": ["editor::ToggleComments", { "advance_downwards": false }],
|
|
"cmd-u": "editor::UndoSelection",
|
|
"cmd-shift-u": "editor::RedoSelection",
|
|
"f8": "editor::GoToDiagnostic",
|
|
"shift-f8": "editor::GoToPrevDiagnostic",
|
|
"f2": "editor::Rename",
|
|
"f12": "editor::GoToDefinition",
|
|
"alt-f12": "editor::GoToDefinitionSplit",
|
|
"cmd-f12": "editor::GoToTypeDefinition",
|
|
"shift-f12": "editor::GoToImplementation",
|
|
"alt-cmd-f12": "editor::GoToTypeDefinitionSplit",
|
|
"alt-shift-f12": "editor::FindAllReferences",
|
|
"ctrl-m": "editor::MoveToEnclosingBracket",
|
|
"cmd-shift-\\": "editor::MoveToEnclosingBracket",
|
|
"alt-cmd-[": "editor::Fold",
|
|
"alt-cmd-]": "editor::UnfoldLines",
|
|
"ctrl-space": "editor::ShowCompletions",
|
|
"cmd-.": "editor::ToggleCodeActions",
|
|
"alt-cmd-r": "editor::RevealInFileManager",
|
|
"cmd-k r": "editor::RevealInFileManager",
|
|
"cmd-k p": "editor::CopyPath",
|
|
"cmd-\\": "pane::SplitRight",
|
|
"cmd-k v": "markdown::OpenPreviewToTheSide",
|
|
"cmd-shift-v": "markdown::OpenPreview",
|
|
"ctrl-cmd-c": "editor::DisplayCursorNames"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && mode == full",
|
|
"bindings": {
|
|
"cmd-shift-o": "outline::Toggle",
|
|
"ctrl-g": "go_to_line::Toggle"
|
|
}
|
|
},
|
|
{
|
|
"context": "Pane",
|
|
"bindings": {
|
|
"ctrl-1": ["pane::ActivateItem", 0],
|
|
"ctrl-2": ["pane::ActivateItem", 1],
|
|
"ctrl-3": ["pane::ActivateItem", 2],
|
|
"ctrl-4": ["pane::ActivateItem", 3],
|
|
"ctrl-5": ["pane::ActivateItem", 4],
|
|
"ctrl-6": ["pane::ActivateItem", 5],
|
|
"ctrl-7": ["pane::ActivateItem", 6],
|
|
"ctrl-8": ["pane::ActivateItem", 7],
|
|
"ctrl-9": ["pane::ActivateItem", 8],
|
|
"ctrl-0": "pane::ActivateLastItem",
|
|
"ctrl--": "pane::GoBack",
|
|
"ctrl-shift--": "pane::GoForward",
|
|
"cmd-shift-t": "pane::ReopenClosedItem",
|
|
"cmd-shift-f": "project_search::ToggleFocus"
|
|
}
|
|
},
|
|
{
|
|
"context": "Workspace",
|
|
"bindings": {
|
|
// Change the default action on `menu::Confirm` by setting the parameter
|
|
// "alt-cmd-o": ["projects::OpenRecent", {"create_new_window": true }],
|
|
"alt-cmd-o": "projects::OpenRecent",
|
|
"alt-cmd-b": "branches::OpenRecent",
|
|
"ctrl-~": "workspace::NewTerminal",
|
|
"cmd-s": "workspace::Save",
|
|
"cmd-k s": "workspace::SaveWithoutFormat",
|
|
"cmd-shift-s": "workspace::SaveAs",
|
|
"cmd-n": "workspace::NewFile",
|
|
"cmd-shift-n": "workspace::NewWindow",
|
|
"ctrl-`": "terminal_panel::ToggleFocus",
|
|
"cmd-1": ["workspace::ActivatePane", 0],
|
|
"cmd-2": ["workspace::ActivatePane", 1],
|
|
"cmd-3": ["workspace::ActivatePane", 2],
|
|
"cmd-4": ["workspace::ActivatePane", 3],
|
|
"cmd-5": ["workspace::ActivatePane", 4],
|
|
"cmd-6": ["workspace::ActivatePane", 5],
|
|
"cmd-7": ["workspace::ActivatePane", 6],
|
|
"cmd-8": ["workspace::ActivatePane", 7],
|
|
"cmd-9": ["workspace::ActivatePane", 8],
|
|
"cmd-b": "workspace::ToggleLeftDock",
|
|
"cmd-r": "workspace::ToggleRightDock",
|
|
"cmd-j": "workspace::ToggleBottomDock",
|
|
"alt-cmd-y": "workspace::CloseAllDocks",
|
|
"cmd-shift-f": "pane::DeploySearch",
|
|
"cmd-shift-h": ["pane::DeploySearch", { "replace_enabled": true }],
|
|
"cmd-k cmd-s": "zed::OpenKeymap",
|
|
"cmd-k cmd-t": "theme_selector::Toggle",
|
|
"cmd-t": "project_symbols::Toggle",
|
|
"cmd-p": "file_finder::Toggle",
|
|
"ctrl-tab": "tab_switcher::Toggle",
|
|
"ctrl-shift-tab": ["tab_switcher::Toggle", { "select_last": true }],
|
|
"cmd-shift-p": "command_palette::Toggle",
|
|
"cmd-shift-m": "diagnostics::Deploy",
|
|
"cmd-shift-e": "project_panel::ToggleFocus",
|
|
"cmd-shift-b": "outline_panel::ToggleFocus",
|
|
"cmd-?": "assistant::ToggleFocus",
|
|
"cmd-alt-s": "workspace::SaveAll",
|
|
"cmd-k m": "language_selector::Toggle",
|
|
"escape": "workspace::Unfollow",
|
|
"cmd-k cmd-left": ["workspace::ActivatePaneInDirection", "Left"],
|
|
"cmd-k cmd-right": ["workspace::ActivatePaneInDirection", "Right"],
|
|
"cmd-k cmd-up": ["workspace::ActivatePaneInDirection", "Up"],
|
|
"cmd-k cmd-down": ["workspace::ActivatePaneInDirection", "Down"],
|
|
"cmd-k shift-left": ["workspace::SwapPaneInDirection", "Left"],
|
|
"cmd-k shift-right": ["workspace::SwapPaneInDirection", "Right"],
|
|
"cmd-k shift-up": ["workspace::SwapPaneInDirection", "Up"],
|
|
"cmd-k shift-down": ["workspace::SwapPaneInDirection", "Down"],
|
|
"cmd-shift-x": "zed::Extensions",
|
|
"alt-t": "task::Rerun",
|
|
"alt-shift-t": "task::Spawn"
|
|
}
|
|
},
|
|
// Bindings from Sublime Text
|
|
{
|
|
"context": "Editor",
|
|
"bindings": {
|
|
"ctrl-j": "editor::JoinLines",
|
|
"ctrl-alt-backspace": "editor::DeleteToPreviousSubwordStart",
|
|
"ctrl-alt-h": "editor::DeleteToPreviousSubwordStart",
|
|
"ctrl-alt-delete": "editor::DeleteToNextSubwordEnd",
|
|
"ctrl-alt-d": "editor::DeleteToNextSubwordEnd",
|
|
"ctrl-alt-left": "editor::MoveToPreviousSubwordStart",
|
|
"ctrl-alt-b": "editor::MoveToPreviousSubwordStart",
|
|
"ctrl-alt-right": "editor::MoveToNextSubwordEnd",
|
|
"ctrl-alt-f": "editor::MoveToNextSubwordEnd",
|
|
"ctrl-alt-shift-left": "editor::SelectToPreviousSubwordStart",
|
|
"ctrl-alt-shift-b": "editor::SelectToPreviousSubwordStart",
|
|
"ctrl-alt-shift-right": "editor::SelectToNextSubwordEnd",
|
|
"ctrl-alt-shift-f": "editor::SelectToNextSubwordEnd"
|
|
}
|
|
},
|
|
// Bindings from Atom
|
|
{
|
|
"context": "Pane",
|
|
"bindings": {
|
|
"cmd-k up": "pane::SplitUp",
|
|
"cmd-k down": "pane::SplitDown",
|
|
"cmd-k left": "pane::SplitLeft",
|
|
"cmd-k right": "pane::SplitRight"
|
|
}
|
|
},
|
|
// Bindings that should be unified with bindings for more general actions
|
|
{
|
|
"context": "Editor && renaming",
|
|
"bindings": {
|
|
"enter": "editor::ConfirmRename"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && showing_completions",
|
|
"bindings": {
|
|
"enter": "editor::ConfirmCompletion",
|
|
"tab": "editor::ComposeCompletion"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && inline_completion && !showing_completions",
|
|
"bindings": {
|
|
"tab": "editor::AcceptInlineCompletion"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && showing_code_actions",
|
|
"bindings": {
|
|
"enter": "editor::ConfirmCodeAction"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && (showing_code_actions || showing_completions)",
|
|
"bindings": {
|
|
"up": "editor::ContextMenuPrev",
|
|
"ctrl-p": "editor::ContextMenuPrev",
|
|
"down": "editor::ContextMenuNext",
|
|
"ctrl-n": "editor::ContextMenuNext",
|
|
"pageup": "editor::ContextMenuFirst",
|
|
"pagedown": "editor::ContextMenuLast"
|
|
}
|
|
},
|
|
// Custom bindings
|
|
{
|
|
"bindings": {
|
|
"ctrl-alt-cmd-f": "workspace::FollowNextCollaborator",
|
|
// TODO: Move this to a dock open action
|
|
"cmd-shift-c": "collab_panel::ToggleFocus",
|
|
"cmd-alt-i": "zed::DebugElements",
|
|
"ctrl-:": "editor::ToggleInlayHints"
|
|
}
|
|
},
|
|
{
|
|
"context": "Editor && mode == full",
|
|
"bindings": {
|
|
"alt-enter": "editor::OpenExcerpts",
|
|
"shift-enter": "editor::ExpandExcerpts",
|
|
"cmd-k enter": "editor::OpenExcerptsSplit",
|
|
"cmd-f8": "editor::GoToHunk",
|
|
"cmd-shift-f8": "editor::GoToPrevHunk",
|
|
"ctrl-enter": "assistant::InlineAssist"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectSearchBar && !in_replace",
|
|
"bindings": {
|
|
"cmd-enter": "project_search::SearchInNew"
|
|
}
|
|
},
|
|
{
|
|
"context": "OutlinePanel",
|
|
"bindings": {
|
|
"escape": "menu::Cancel",
|
|
"left": "outline_panel::CollapseSelectedEntry",
|
|
"right": "outline_panel::ExpandSelectedEntry",
|
|
"cmd-alt-c": "outline_panel::CopyPath",
|
|
"alt-cmd-shift-c": "outline_panel::CopyRelativePath",
|
|
"alt-cmd-r": "outline_panel::RevealInFileManager",
|
|
"space": ["outline_panel::Open", { "change_selection": false }],
|
|
"shift-down": "menu::SelectNext",
|
|
"shift-up": "menu::SelectPrev"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectPanel",
|
|
"bindings": {
|
|
"left": "project_panel::CollapseSelectedEntry",
|
|
"right": "project_panel::ExpandSelectedEntry",
|
|
"cmd-n": "project_panel::NewFile",
|
|
"cmd-d": "project_panel::Duplicate",
|
|
"alt-cmd-n": "project_panel::NewDirectory",
|
|
"cmd-x": "project_panel::Cut",
|
|
"cmd-c": "project_panel::Copy",
|
|
"cmd-v": "project_panel::Paste",
|
|
"cmd-alt-c": "project_panel::CopyPath",
|
|
"alt-cmd-shift-c": "project_panel::CopyRelativePath",
|
|
"enter": "project_panel::Rename",
|
|
"f2": "project_panel::Rename",
|
|
"backspace": ["project_panel::Trash", { "skip_prompt": false }],
|
|
"delete": ["project_panel::Trash", { "skip_prompt": false }],
|
|
"cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }],
|
|
"cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],
|
|
"alt-cmd-r": "project_panel::RevealInFileManager",
|
|
"cmd-alt-backspace": ["project_panel::Delete", { "skip_prompt": false }],
|
|
|
|
"alt-shift-f": "project_panel::NewSearchInDirectory",
|
|
"shift-down": "menu::SelectNext",
|
|
"shift-up": "menu::SelectPrev",
|
|
"escape": "menu::Cancel"
|
|
}
|
|
},
|
|
{
|
|
"context": "ProjectPanel && not_editing",
|
|
"bindings": {
|
|
"space": "project_panel::Open"
|
|
}
|
|
},
|
|
{
|
|
"context": "CollabPanel && not_editing",
|
|
"bindings": {
|
|
"ctrl-backspace": "collab_panel::Remove",
|
|
"space": "menu::Confirm"
|
|
}
|
|
},
|
|
{
|
|
"context": "(CollabPanel && editing) > Editor",
|
|
"bindings": {
|
|
"space": "collab_panel::InsertSpace"
|
|
}
|
|
},
|
|
{
|
|
"context": "ChannelModal",
|
|
"bindings": {
|
|
"tab": "channel_modal::ToggleMode"
|
|
}
|
|
},
|
|
{
|
|
"context": "Picker > Editor",
|
|
"bindings": {
|
|
"tab": "picker::ConfirmCompletion",
|
|
"alt-enter": ["picker::ConfirmInput", { "secondary": false }],
|
|
"cmd-alt-enter": ["picker::ConfirmInput", { "secondary": true }]
|
|
}
|
|
},
|
|
{
|
|
"context": "ChannelModal > Picker > Editor",
|
|
"bindings": {
|
|
"tab": "channel_modal::ToggleMode"
|
|
}
|
|
},
|
|
{
|
|
"context": "FileFinder",
|
|
"bindings": { "cmd-shift-p": "file_finder::SelectPrev" }
|
|
},
|
|
{
|
|
"context": "TabSwitcher",
|
|
"bindings": {
|
|
"ctrl-up": "menu::SelectPrev",
|
|
"ctrl-down": "menu::SelectNext",
|
|
"ctrl-shift-tab": "menu::SelectPrev",
|
|
"ctrl-backspace": "tab_switcher::CloseSelectedItem"
|
|
}
|
|
},
|
|
{
|
|
"context": "Terminal",
|
|
"bindings": {
|
|
"ctrl-cmd-space": "terminal::ShowCharacterPalette",
|
|
"cmd-c": "terminal::Copy",
|
|
"cmd-v": "terminal::Paste",
|
|
"cmd-a": "editor::SelectAll",
|
|
"cmd-k": "terminal::Clear",
|
|
"ctrl-enter": "assistant::InlineAssist",
|
|
// Some nice conveniences
|
|
"cmd-backspace": ["terminal::SendText", "\u0015"],
|
|
"cmd-right": ["terminal::SendText", "\u0005"],
|
|
"cmd-left": ["terminal::SendText", "\u0001"],
|
|
// Terminal.app compatibility
|
|
"alt-left": ["terminal::SendText", "\u001bb"],
|
|
"alt-right": ["terminal::SendText", "\u001bf"],
|
|
// There are conflicting bindings for these keys in the global context.
|
|
// these bindings override them, remove at your own risk:
|
|
"up": ["terminal::SendKeystroke", "up"],
|
|
"pageup": ["terminal::SendKeystroke", "pageup"],
|
|
"down": ["terminal::SendKeystroke", "down"],
|
|
"pagedown": ["terminal::SendKeystroke", "pagedown"],
|
|
"escape": ["terminal::SendKeystroke", "escape"],
|
|
"enter": ["terminal::SendKeystroke", "enter"],
|
|
"ctrl-c": ["terminal::SendKeystroke", "ctrl-c"],
|
|
"cmd-up": "terminal::ScrollPageUp",
|
|
"cmd-down": "terminal::ScrollPageDown",
|
|
"shift-pageup": "terminal::ScrollPageUp",
|
|
"shift-pagedown": "terminal::ScrollPageDown",
|
|
"shift-up": "terminal::ScrollLineUp",
|
|
"shift-down": "terminal::ScrollLineDown",
|
|
"cmd-home": "terminal::ScrollToTop",
|
|
"cmd-end": "terminal::ScrollToBottom",
|
|
"shift-home": "terminal::ScrollToTop",
|
|
"shift-end": "terminal::ScrollToBottom"
|
|
}
|
|
}
|
|
]
|