From bbbc168f50cdb448ceef6f8f67da29de0475cdd2 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Fri, 22 Aug 2025 15:53:14 +0530 Subject: [PATCH] clean up Co-authored-by: Oleksiy Syvokon --- assets/settings/default.json | 4 ++++ crates/zed/src/zed.rs | 2 +- crates/zed/src/zed/quick_action_bar.rs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 3f2b0a159f6da94db385615c09fd00104e47a2aa..2f24416f42978f7ac5f1c333ca1272113a06ebea 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -111,6 +111,10 @@ // 2. Maps `Control` on Linux and Windows and to `Command` on MacOS: // "cmd_or_ctrl" (alias: "cmd", "ctrl") "multi_cursor_modifier": "alt", + /// Weather to set editor mode to vim, vim insert, helix, etc. + /// + /// Default: default + "editor_mode": "default", // Whether to enable vim modes and key bindings. "vim_mode": false, // Whether to enable helix mode and key bindings. diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index c8b3c9e111dfbce2e38adf52f8180e62eb41d18e..2d47c07ad65b30fc88ac573b47c03e5e4f214be3 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -70,7 +70,7 @@ use ui::{PopoverMenuHandle, prelude::*}; use util::markdown::MarkdownString; use util::{ResultExt, asset_str}; use uuid::Uuid; -use vim_mode_setting::{EditorMode, EditorModeSetting}; +use vim_mode_setting::EditorModeSetting; use workspace::notifications::{ NotificationId, SuppressEvent, dismiss_app_notification, show_app_notification, }; diff --git a/crates/zed/src/zed/quick_action_bar.rs b/crates/zed/src/zed/quick_action_bar.rs index 1a147c683467bf73491cdbb88ef47700375cd5d0..34eac520f260e8dbf5e5c1569832ae9fbb301d50 100644 --- a/crates/zed/src/zed/quick_action_bar.rs +++ b/crates/zed/src/zed/quick_action_bar.rs @@ -578,9 +578,9 @@ impl Render for QuickActionBar { { move |window, cx| { let new_value = if vim_mode_enabled { - EditorMode::Default + EditorMode::default() } else { - EditorMode::Vim + EditorMode::vim() }; EditorModeSetting::override_global(EditorModeSetting(new_value), cx); window.refresh();