mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-03 05:51:27 +01:00
4ba7d82f68
## Summary Closes #66136 With the JetBrains keymap on macOS, cmd-o opens the file dialog instead of expected symbol search. The fix: unbind the inherited Open with zed::Unbind, like linux/emacs.json does for ctrl-n/ctrl-p. so after fix File > Open no longer shows cmd-o ## Testing - added test_jetbrains_project_symbol_shortcuts_override_open. Also added shared helped in tests for similar case with emacs. - manually tested on macOS. ran cargo run, choose jetbrains keymap on startup, and voila cmd-o opens symbols. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed `cmd-o` opening the file dialog instead of project symbol search when using the JetBrains keymap on macOS. --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
241 lines
8.5 KiB
JSON
241 lines
8.5 KiB
JSON
[
|
|
{
|
|
"context": "Workspace",
|
|
"use_key_equivalents": true,
|
|
"bindings": {
|
|
"cmd-o": null,
|
|
},
|
|
},
|
|
{
|
|
"bindings": {
|
|
"cmd-{": "pane::ActivatePreviousItem",
|
|
"cmd-}": "pane::ActivateNextItem",
|
|
"cmd-0": "git_panel::ToggleFocus", // overrides `cmd-0` zoom reset
|
|
"shift-escape": null, // Unmap workspace::zoom
|
|
"cmd-~": "git::Branch",
|
|
"ctrl-f2": "debugger::Stop",
|
|
"f6": "debugger::Pause",
|
|
"f7": "debugger::StepInto",
|
|
"f8": "debugger::StepOver",
|
|
"shift-f8": "debugger::StepOut",
|
|
"f9": "debugger::Continue",
|
|
"shift-f9": "debugger::Start",
|
|
"alt-shift-f9": "debugger::Start",
|
|
},
|
|
},
|
|
{
|
|
"context": "Editor",
|
|
"bindings": {
|
|
"ctrl->": ["zed::IncreaseBufferFontSize", { "persist": true }],
|
|
"ctrl-<": ["zed::DecreaseBufferFontSize", { "persist": true }],
|
|
"ctrl-shift-j": "editor::JoinLines",
|
|
"cmd-d": "editor::DuplicateSelection",
|
|
"cmd-backspace": "editor::DeleteLine",
|
|
"cmd-pagedown": "editor::MovePageDown",
|
|
"cmd-pageup": "editor::MovePageUp",
|
|
"ctrl-alt-shift-b": "editor::SelectToPreviousWordStart",
|
|
"cmd-alt-enter": "editor::NewlineAbove",
|
|
"shift-enter": "editor::NewlineBelow",
|
|
"cmd--": "editor::Fold",
|
|
"cmd-+": "editor::UnfoldLines",
|
|
"alt-shift-g": "editor::SplitSelectionIntoLines",
|
|
"ctrl-g": ["editor::SelectNext", { "replace_newest": false }],
|
|
"ctrl-shift-g": "editor::UndoSelection",
|
|
"ctrl-cmd-g": ["editor::SelectPrevious", { "replace_newest": false }],
|
|
"cmd-/": ["editor::ToggleComments", { "advance_downwards": true, "comment_empty_lines": true }],
|
|
"alt-up": "editor::SelectLargerSyntaxNode",
|
|
"alt-down": "editor::SelectSmallerSyntaxNode",
|
|
"shift-alt-up": "editor::MoveLineUp",
|
|
"shift-alt-down": "editor::MoveLineDown",
|
|
"cmd-alt-l": "editor::Format",
|
|
"ctrl-alt-o": "editor::OrganizeImports",
|
|
"shift-f6": "editor::Rename",
|
|
"cmd-[": "pane::GoBack",
|
|
"cmd-]": "pane::GoForward",
|
|
"alt-f7": "editor::FindAllReferences",
|
|
"cmd-alt-f7": "editor::FindAllReferences",
|
|
"cmd-b": "editor::GoToDefinition", // Conflicts with workspace::ToggleLeftDock
|
|
"cmd-alt-b": "editor::GoToImplementation",
|
|
"cmd-shift-b": "editor::GoToTypeDefinition",
|
|
"cmd-alt-shift-b": "editor::GoToTypeDefinitionSplit",
|
|
"f2": "editor::GoToDiagnostic",
|
|
"shift-f2": "editor::GoToPreviousDiagnostic",
|
|
"ctrl-alt-shift-down": "editor::GoToHunk",
|
|
"ctrl-alt-shift-up": "editor::GoToPreviousHunk",
|
|
"cmd-home": "editor::MoveToBeginning",
|
|
"cmd-end": "editor::MoveToEnd",
|
|
"cmd-shift-home": "editor::SelectToBeginning",
|
|
"cmd-shift-end": "editor::SelectToEnd",
|
|
"alt-left": "editor::MoveToPreviousSubwordStart",
|
|
"alt-right": "editor::MoveToNextSubwordEnd",
|
|
"shift-alt-left": "editor::SelectToPreviousSubwordStart",
|
|
"shift-alt-right": "editor::SelectToNextSubwordEnd",
|
|
"ctrl-f8": "editor::ToggleBreakpoint",
|
|
"ctrl-shift-f8": "editor::EditLogBreakpoint",
|
|
"cmd-shift-u": "editor::ToggleCase",
|
|
},
|
|
},
|
|
{
|
|
"context": "Editor && mode == full",
|
|
"bindings": {
|
|
"cmd-f12": "outline::Toggle",
|
|
"cmd-r": ["buffer_search::Deploy", { "replace_enabled": true }],
|
|
"cmd-l": "go_to_line::Toggle",
|
|
"cmd-e": "file_finder::Toggle",
|
|
"cmd-shift-o": "file_finder::Toggle",
|
|
"cmd-shift-n": "file_finder::Toggle",
|
|
"alt-enter": "editor::ToggleCodeActions",
|
|
"ctrl-space": "editor::ShowCompletions",
|
|
"cmd-j": "editor::Hover",
|
|
"cmd-p": "editor::ShowSignatureHelp",
|
|
"cmd-\\": "assistant::InlineAssist",
|
|
"ctrl-alt-h": "call_hierarchy::ShowIncomingCalls",
|
|
},
|
|
},
|
|
{
|
|
"context": "Editor && mode == auto_height",
|
|
"bindings": {
|
|
"shift-enter": "editor::Newline",
|
|
"ctrl-shift-enter": "editor::NewlineBelow",
|
|
},
|
|
},
|
|
{
|
|
"context": "BufferSearchBar && !in_replace > Editor",
|
|
"bindings": {
|
|
"shift-enter": "search::SelectPreviousMatch",
|
|
},
|
|
},
|
|
{
|
|
"context": "AcpThreadSearchBar > Editor",
|
|
"bindings": {
|
|
"shift-enter": "agent::SelectPreviousThreadMatch",
|
|
},
|
|
},
|
|
{
|
|
"context": "BufferSearchBar || ProjectSearchBar",
|
|
"bindings": {
|
|
"alt-c": "search::ToggleCaseSensitive",
|
|
"alt-e": "search::ToggleSelection",
|
|
"alt-x": "search::ToggleRegex",
|
|
"alt-w": "search::ToggleWholeWord",
|
|
"ctrl-alt-c": "search::ToggleCaseSensitive",
|
|
"ctrl-alt-e": "search::ToggleSelection",
|
|
"ctrl-alt-w": "search::ToggleWholeWord",
|
|
"ctrl-alt-x": "search::ToggleRegex",
|
|
},
|
|
},
|
|
{
|
|
"context": "Workspace",
|
|
"bindings": {
|
|
"cmd-shift-f12": "workspace::ToggleAllDocks",
|
|
"cmd-shift-r": ["pane::DeploySearch", { "replace_enabled": true }],
|
|
"ctrl-alt-r": "task::Spawn",
|
|
"shift-f10": "task::Spawn",
|
|
"cmd-f5": "task::Rerun",
|
|
"cmd-e": "file_finder::Toggle",
|
|
"cmd-k": "git_panel::FocusEditor",
|
|
"cmd-shift-o": "file_finder::Toggle",
|
|
"cmd-shift-n": "file_finder::Toggle",
|
|
"cmd-n": "project_symbols::Toggle",
|
|
"cmd-shift-a": "command_palette::Toggle",
|
|
"shift shift": "command_palette::Toggle",
|
|
"cmd-alt-o": "project_symbols::Toggle", // JetBrains: Go to Symbol
|
|
"cmd-o": "project_symbols::Toggle", // JetBrains: Go to Class
|
|
"cmd-1": "project_panel::ToggleFocus",
|
|
"cmd-5": "debug_panel::ToggleFocus",
|
|
"cmd-6": "diagnostics::Deploy",
|
|
"cmd-7": "outline_panel::ToggleFocus",
|
|
},
|
|
},
|
|
{
|
|
"context": "Pane", // this is to override the default Pane mappings to switch tabs
|
|
"bindings": {
|
|
"cmd-1": "project_panel::ToggleFocus",
|
|
"cmd-2": null, // Bookmarks (left dock)
|
|
"cmd-3": null, // Find Panel (bottom dock)
|
|
"cmd-4": null, // Run Panel (bottom dock)
|
|
"cmd-5": "debug_panel::ToggleFocus",
|
|
"cmd-6": "diagnostics::Deploy",
|
|
"cmd-7": "outline_panel::ToggleFocus",
|
|
"cmd-8": null, // Services (bottom dock)
|
|
"cmd-9": null, // Git History (bottom dock)
|
|
"cmd-0": "git_panel::ToggleFocus",
|
|
},
|
|
},
|
|
{
|
|
"context": "Workspace || Editor",
|
|
"bindings": {
|
|
"alt-f12": "terminal_panel::Toggle",
|
|
"cmd-shift-k": "git::Push",
|
|
},
|
|
},
|
|
{
|
|
"context": "Pane",
|
|
"bindings": {
|
|
"cmd-alt-left": "pane::GoBack",
|
|
"cmd-alt-right": "pane::GoForward",
|
|
"alt-left": "pane::ActivatePreviousItem",
|
|
"alt-right": "pane::ActivateNextItem",
|
|
},
|
|
},
|
|
{
|
|
"context": "ProjectPanel",
|
|
"bindings": {
|
|
"enter": "project_panel::Open",
|
|
"cmd-shift-f": "project_panel::NewSearchInDirectory",
|
|
"cmd-backspace": ["project_panel::Trash", { "skip_prompt": false }],
|
|
"backspace": ["project_panel::Trash", { "skip_prompt": false }],
|
|
"delete": ["project_panel::Trash", { "skip_prompt": false }],
|
|
"shift-delete": ["project_panel::Delete", { "skip_prompt": false }],
|
|
"shift-f6": "project_panel::Rename",
|
|
},
|
|
},
|
|
{
|
|
"context": "Terminal",
|
|
"bindings": {
|
|
"cmd-t": "workspace::NewTerminal",
|
|
"alt-f12": "workspace::CloseActiveDock",
|
|
"cmd-up": "terminal::ScrollLineUp",
|
|
"cmd-down": "terminal::ScrollLineDown",
|
|
"shift-pageup": "terminal::ScrollPageUp",
|
|
"shift-pagedown": "terminal::ScrollPageDown",
|
|
},
|
|
},
|
|
{ "context": "GitPanel", "bindings": { "cmd-0": "workspace::CloseActiveDock" } },
|
|
{ "context": "ProjectPanel", "bindings": { "cmd-1": "workspace::CloseActiveDock" } },
|
|
{ "context": "DebugPanel", "bindings": { "cmd-5": "workspace::CloseActiveDock" } },
|
|
{ "context": "Diagnostics > Editor", "bindings": { "cmd-6": "pane::CloseActiveItem" } },
|
|
{ "context": "OutlinePanel", "bindings": { "cmd-7": "workspace::CloseActiveDock" } },
|
|
{
|
|
// `cmd-alt-l` is bound to `editor::Format` (jetbrains "Reformat Code") in
|
|
// the Editor context above, which collides with the default
|
|
// `agent::OpenRulesLibrary` binding. Mirror the windows keymap and use
|
|
// `shift-alt-l` instead so the menu hint and the action stay in sync.
|
|
"context": "AgentPanel",
|
|
"bindings": {
|
|
"cmd-alt-l": null,
|
|
"shift-alt-l": "agent::OpenRulesLibrary",
|
|
},
|
|
},
|
|
{
|
|
"context": "Dock || Workspace || OutlinePanel || ProjectPanel || CollabPanel",
|
|
"bindings": {
|
|
"escape": "editor::ToggleFocus",
|
|
"shift-escape": "workspace::CloseActiveDock",
|
|
},
|
|
},
|
|
{
|
|
"context": "Editor && mode == auto_height",
|
|
"bindings": {
|
|
"escape": "editor::Cancel",
|
|
},
|
|
},
|
|
{
|
|
"context": "CallHierarchyPicker > Picker > Editor",
|
|
"bindings": {
|
|
"ctrl-alt-h": "call_hierarchy::ToggleDirection",
|
|
"cmd-k": null,
|
|
},
|
|
},
|
|
]
|