Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
vim netrw (#7962)
Conrad Irwin4c781b6455e5
diff --git a/Cargo.lock b/Cargo.lockindex e0424551eab..7d8b74a79c3 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -10837,7 +10837,6 @@ dependencies = ["collections","command_palette","copilot",- "diagnostics","editor","futures 0.3.28","gpui",@@ -10849,7 +10848,6 @@ dependencies = ["nvim-rs","parking_lot 0.11.2","project",- "project_panel","regex","release_channel","search",diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.jsonindex 7570877b76c..14fd118771d 100644--- a/assets/keymaps/vim.json+++ b/assets/keymaps/vim.json@@ -509,31 +509,25 @@}},{- // Directory expansion+ // netrw compatibility"context": "ProjectPanel && not_editing","bindings": {- "escape": "project_panel::ToggleFocus",- "enter": "project_panel::Open",- "o": "project_panel::Open",- "t": "project_panel::Open",- "v": "project_panel::Open",- "d": "project_panel::NewDirectory",+ ":": "command_palette::Toggle","%": "project_panel::NewFile",- "shift-r": "project_panel::Rename",- "m m": "project_panel::Cut",- "m c": "project_panel::Copy",- "m t": "project_panel::Paste",- "x": "project_panel::RevealInFinder",- "l": "project_panel::ExpandSelectedEntry",+ "/": "project_panel::NewSearchInDirectory",+ "d": "project_panel::NewDirectory",+ "enter": "project_panel::Open",+ "escape": "project_panel::ToggleFocus","h": "project_panel::CollapseSelectedEntry",- // Move up and down"j": "menu::SelectNext","k": "menu::SelectPrev",+ "l": "project_panel::ExpandSelectedEntry",+ "o": "project_panel::Open","shift-d": "project_panel::Delete",- "/": "project_panel::NewSearchInDirectory",- // zed specific- "q p": "project_panel::CopyPath",- "q r": "project_panel::CopyRelativePath"+ "shift-r": "project_panel::Rename",+ "t": "project_panel::Open",+ "v": "project_panel::Open",+ "x": "project_panel::RevealInFinder"}}]diff --git a/crates/vim/Cargo.toml b/crates/vim/Cargo.tomlindex bf56d67e9cd..05f8dafe3d0 100644--- a/crates/vim/Cargo.toml+++ b/crates/vim/Cargo.toml@@ -20,8 +20,6 @@ collections.workspace = truecommand_palette.workspace = true# HACK: We're only depending on `copilot` here for `CommandPaletteFilter`. See the attached comment on that type.copilot.workspace = true-project_panel.workspace = true-diagnostics.workspace = trueeditor.workspace = truegpui.workspace = trueitertools = "0.10"diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rsindex 9e8b200a7e5..d60964041f0 100644--- a/crates/vim/src/command.rs+++ b/crates/vim/src/command.rs@@ -31,7 +31,7 @@ pub fn register(workspace: &mut Workspace, _: &mut ViewContext<Workspace>) {});}-pub fn command_interceptor(mut query: &str, _: &AppContext) -> Option<CommandInterceptResult> {+pub fn command_interceptor(mut query: &str, cx: &AppContext) -> Option<CommandInterceptResult> {// Note: this is a very poor simulation of vim's command palette.// In the future we should adjust it to handle parsing range syntax,// and then calling the appropriate commands with/without ranges.@@ -203,7 +203,10 @@ pub fn command_interceptor(mut query: &str, _: &AppContext) -> Option<CommandInt),// quickfix / loclist (merged together for now)- "cl" | "cli" | "clis" | "clist" => ("clist", diagnostics::Deploy.boxed_clone()),+ "cl" | "cli" | "clis" | "clist" => (+ "clist",+ cx.build_action("diagnostics::Deploy", None).unwrap(),+ ),"cc" => ("cc", editor::actions::Hover.boxed_clone()),"ll" => ("ll", editor::actions::Hover.boxed_clone()),"cn" | "cne" | "cnex" | "cnext" => ("cnext", editor::actions::GoToDiagnostic.boxed_clone()),@@ -234,21 +237,55 @@ pub fn command_interceptor(mut query: &str, _: &AppContext) -> Option<CommandInt"sor i" | "sort i" => ("sort i", SortLinesCaseInsensitive.boxed_clone()),// Explore, etc.- "E" | "Ex" | "Exp" | "Expl" | "Explo" | "Explor" | "Explore" => {- ("Explore", project_panel::ToggleFocus.boxed_clone())- }- "H" | "He" | "Hex" | "Hexp" | "Hexpl" | "Hexplo" | "Hexplor" | "Hexplore" => {- ("Hexplore", project_panel::ToggleFocus.boxed_clone())- }- "L" | "Le" | "Lex" | "Lexp" | "Lexpl" | "Lexplo" | "Lexplor" | "Lexplore" => {- ("Lexplore", project_panel::ToggleFocus.boxed_clone())- }- "S" | "Se" | "Sex" | "Sexp" | "Sexpl" | "Sexplo" | "Sexplor" | "Sexplore" => {- ("Sexplore", project_panel::ToggleFocus.boxed_clone())- }- "Ve" | "Vex" | "Vexp" | "Vexpl" | "Vexplo" | "Vexplor" | "Vexplore" => {- ("Vexplore", project_panel::ToggleFocus.boxed_clone())- }+ "E" | "Ex" | "Exp" | "Expl" | "Explo" | "Explor" | "Explore" => (+ "Explore",+ cx.build_action("project_panel::ToggleFocus", None).unwrap(),+ ),+ "H" | "He" | "Hex" | "Hexp" | "Hexpl" | "Hexplo" | "Hexplor" | "Hexplore" => (+ "Hexplore",+ cx.build_action("project_panel::ToggleFocus", None).unwrap(),+ ),+ "L" | "Le" | "Lex" | "Lexp" | "Lexpl" | "Lexplo" | "Lexplor" | "Lexplore" => (+ "Lexplore",+ cx.build_action("project_panel::ToggleFocus", None).unwrap(),+ ),+ "S" | "Se" | "Sex" | "Sexp" | "Sexpl" | "Sexplo" | "Sexplor" | "Sexplore" => (+ "Sexplore",+ cx.build_action("project_panel::ToggleFocus", None).unwrap(),+ ),+ "Ve" | "Vex" | "Vexp" | "Vexpl" | "Vexplo" | "Vexplor" | "Vexplore" => (+ "Vexplore",+ cx.build_action("project_panel::ToggleFocus", None).unwrap(),+ ),+ "te" | "ter" | "term" => (+ "term",+ cx.build_action("terminal_panel::ToggleFocus", None)+ .unwrap(),+ ),+ // Zed panes+ "T" | "Te" | "Ter" | "Term" => (+ "Term",+ cx.build_action("terminal_panel::ToggleFocus", None)+ .unwrap(),+ ),+ "C" | "Co" | "Col" | "Coll" | "Colla" | "Collab" => (+ "Collab",+ cx.build_action("collab_panel::ToggleFocus", None).unwrap(),+ ),+ "Ch" | "Cha" | "Chat" => (+ "Chat",+ cx.build_action("chat_panel::ToggleFocus", None).unwrap(),+ ),+ "No" | "Not" | "Noti" | "Notif" | "Notifi" | "Notific" | "Notifica" | "Notificat"+ | "Notificati" | "Notificatio" | "Notification" => (+ "Notifications",+ cx.build_action("notification_panel::ToggleFocus", None)+ .unwrap(),+ ),+ "A" | "AI" | "Ai" => (+ "AI",+ cx.build_action("assistant::ToggleFocus", None).unwrap(),+ ),// goto (other ranges handled under _ => )"$" => ("$", EndOfDocument.boxed_clone()),