diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index 659dde7c5b..f3f2c31d2c 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -1,12 +1,8 @@ use editor::Editor; use fuzzy::PathMatch; use gpui::{ - actions, - elements::*, - impl_internal_actions, - keymap::{self, Binding}, - AppContext, Axis, Entity, ModelHandle, MutableAppContext, RenderContext, Task, View, - ViewContext, ViewHandle, WeakViewHandle, + actions, elements::*, impl_internal_actions, keymap, AppContext, Axis, Entity, ModelHandle, + MutableAppContext, RenderContext, Task, View, ViewContext, ViewHandle, WeakViewHandle, }; use project::{Project, ProjectPath, WorktreeId}; use settings::Settings; @@ -50,11 +46,6 @@ pub fn init(cx: &mut MutableAppContext) { cx.add_action(FileFinder::select); cx.add_action(FileFinder::select_prev); cx.add_action(FileFinder::select_next); - - cx.add_bindings(vec![ - Binding::new("cmd-p", Toggle, None), - Binding::new("escape", Toggle, Some("FileFinder")), - ]); } pub enum Event { diff --git a/crates/go_to_line/src/go_to_line.rs b/crates/go_to_line/src/go_to_line.rs index 9995736550..16b633ad72 100644 --- a/crates/go_to_line/src/go_to_line.rs +++ b/crates/go_to_line/src/go_to_line.rs @@ -1,7 +1,7 @@ use editor::{display_map::ToDisplayPoint, Autoscroll, DisplayPoint, Editor}; use gpui::{ - actions, elements::*, geometry::vector::Vector2F, keymap::Binding, Axis, Entity, - MutableAppContext, RenderContext, View, ViewContext, ViewHandle, + actions, elements::*, geometry::vector::Vector2F, Axis, Entity, MutableAppContext, + RenderContext, View, ViewContext, ViewHandle, }; use settings::Settings; use text::{Bias, Point}; @@ -10,11 +10,6 @@ use workspace::Workspace; actions!(go_to_line, [Toggle, Confirm]); pub fn init(cx: &mut MutableAppContext) { - cx.add_bindings([ - Binding::new("ctrl-g", Toggle, Some("Editor")), - Binding::new("escape", Toggle, Some("GoToLine")), - Binding::new("enter", Confirm, Some("GoToLine")), - ]); cx.add_action(GoToLine::toggle); cx.add_action(GoToLine::confirm); } diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs index 5386657ef2..08bc18a016 100644 --- a/crates/outline/src/outline.rs +++ b/crates/outline/src/outline.rs @@ -4,12 +4,8 @@ use editor::{ }; use fuzzy::StringMatch; use gpui::{ - actions, - elements::*, - geometry::vector::Vector2F, - keymap::{self, Binding}, - AppContext, Axis, Entity, MutableAppContext, RenderContext, View, ViewContext, ViewHandle, - WeakViewHandle, + actions, elements::*, geometry::vector::Vector2F, keymap, AppContext, Axis, Entity, + MutableAppContext, RenderContext, View, ViewContext, ViewHandle, WeakViewHandle, }; use language::Outline; use ordered_float::OrderedFloat; @@ -23,10 +19,6 @@ use workspace::{ actions!(outline, [Toggle]); pub fn init(cx: &mut MutableAppContext) { - cx.add_bindings([ - Binding::new("cmd-shift-O", Toggle, Some("Editor")), - Binding::new("escape", Toggle, Some("OutlineView")), - ]); cx.add_action(OutlineView::toggle); cx.add_action(OutlineView::confirm); cx.add_action(OutlineView::select_prev); diff --git a/crates/project_symbols/src/project_symbols.rs b/crates/project_symbols/src/project_symbols.rs index 689f579b81..c14f7bea33 100644 --- a/crates/project_symbols/src/project_symbols.rs +++ b/crates/project_symbols/src/project_symbols.rs @@ -3,11 +3,8 @@ use editor::{ }; use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ - actions, - elements::*, - keymap::{self, Binding}, - AppContext, Axis, Entity, ModelHandle, MutableAppContext, RenderContext, Task, View, - ViewContext, ViewHandle, WeakViewHandle, + actions, elements::*, keymap, AppContext, Axis, Entity, ModelHandle, MutableAppContext, + RenderContext, Task, View, ViewContext, ViewHandle, WeakViewHandle, }; use ordered_float::OrderedFloat; use project::{Project, Symbol}; @@ -25,10 +22,6 @@ use workspace::{ actions!(project_symbols, [Toggle]); pub fn init(cx: &mut MutableAppContext) { - cx.add_bindings([ - Binding::new("cmd-t", Toggle, None), - Binding::new("escape", Toggle, Some("ProjectSymbolsView")), - ]); cx.add_action(ProjectSymbolsView::toggle); cx.add_action(ProjectSymbolsView::confirm); cx.add_action(ProjectSymbolsView::select_prev); diff --git a/crates/theme_selector/src/theme_selector.rs b/crates/theme_selector/src/theme_selector.rs index 733df65b82..37099eb510 100644 --- a/crates/theme_selector/src/theme_selector.rs +++ b/crates/theme_selector/src/theme_selector.rs @@ -1,11 +1,8 @@ use editor::Editor; use fuzzy::{match_strings, StringMatch, StringMatchCandidate}; use gpui::{ - actions, - elements::*, - keymap::{self, Binding}, - AppContext, Axis, Element, ElementBox, Entity, MutableAppContext, RenderContext, View, - ViewContext, ViewHandle, + actions, elements::*, keymap, AppContext, Axis, Element, ElementBox, Entity, MutableAppContext, + RenderContext, View, ViewContext, ViewHandle, }; use settings::Settings; use std::{cmp, sync::Arc}; @@ -33,12 +30,6 @@ pub fn init(cx: &mut MutableAppContext) { cx.add_action(ThemeSelector::select_next); cx.add_action(ThemeSelector::toggle); cx.add_action(ThemeSelector::reload); - - cx.add_bindings(vec![ - Binding::new("cmd-k cmd-t", Toggle, None), - Binding::new("cmd-k t", Reload, None), - Binding::new("escape", Toggle, Some("ThemeSelector")), - ]); } pub enum Event { diff --git a/crates/zed/assets/keymaps/default.json b/crates/zed/assets/keymaps/default.json index c121edad76..addd5ffb1e 100644 --- a/crates/zed/assets/keymaps/default.json +++ b/crates/zed/assets/keymaps/default.json @@ -47,7 +47,11 @@ "cmd-shift-G": "search::SelectPrevMatch" }, "Workspace": { - "cmd-shift-F": "project_search::Deploy" + "cmd-shift-F": "project_search::Deploy", + "cmd-k cmd-t": "theme_selector::Toggle", + "cmd-k t": "theme_selector::Reload", + "cmd-t": "project_symbols::Toggle", + "cmd-p": "file_finder::Toggle" }, "ProjectSearchBar": { "enter": "project_search::Search", @@ -217,12 +221,30 @@ { "focus": false } - ] + ], + "cmd-shift-O": "outline::Toggle", + "ctrl-g": "go_to_line::Toggle" }, "Editor && mode == auto_height": { "alt-enter": [ "editor::Input", "\n" ] + }, + "OutlineView": { + "escape": "outline::Toggle" + }, + "ProjectSymbolsView": { + "escape": "project_symbols::Toggle" + }, + "ThemeSelector": { + "escape": "theme_selector::Toggle" + }, + "GoToLine": { + "escape": "go_to_line::Toggle", + "enter": "go_to_line::Confirm" + }, + "FileFinder": { + "escape": "file_finder::Toggle" } } \ No newline at end of file