diff --git a/crates/settings/src/settings_content/theme.rs b/crates/settings/src/settings_content/theme.rs index d0c2a51d62a9a064e0f9fce3e8bee05b0227c549..2569b09a9bd4f6995841d286c555a9b21d26b764 100644 --- a/crates/settings/src/settings_content/theme.rs +++ b/crates/settings/src/settings_content/theme.rs @@ -961,10 +961,30 @@ pub struct ThemeColorsContent { /// Background color for Vim Helix Select mode indicator. #[serde(rename = "vim.helix_select.background")] pub vim_helix_select_background: Option, - - /// Text color for Vim mode indicator label. - #[serde(rename = "vim.mode.text")] - pub vim_mode_text: Option, + /// Background color for Vim Normal mode indicator. + #[serde(rename = "vim.normal.foreground")] + pub vim_normal_foreground: Option, + /// Foreground color for Vim Insert mode indicator. + #[serde(rename = "vim.insert.foreground")] + pub vim_insert_foreground: Option, + /// Foreground color for Vim Replace mode indicator. + #[serde(rename = "vim.replace.foreground")] + pub vim_replace_foreground: Option, + /// Foreground color for Vim Visual mode indicator. + #[serde(rename = "vim.visual.foreground")] + pub vim_visual_foreground: Option, + /// Foreground color for Vim Visual Line mode indicator. + #[serde(rename = "vim.visual_line.foreground")] + pub vim_visual_line_foreground: Option, + /// Foreground color for Vim Visual Block mode indicator. + #[serde(rename = "vim.visual_block.foreground")] + pub vim_visual_block_foreground: Option, + /// Foreground color for Vim Helix Normal mode indicator. + #[serde(rename = "vim.helix_normal.foreground")] + pub vim_helix_normal_foreground: Option, + /// Foreground color for Vim Helix Select mode indicator. + #[serde(rename = "vim.helix_select.foreground")] + pub vim_helix_select_foreground: Option, } #[derive(Debug, Clone, Default, Serialize, Deserialize, JsonSchema, MergeFrom, PartialEq)] diff --git a/crates/theme/src/default_colors.rs b/crates/theme/src/default_colors.rs index 82be2896c67f155ac61de1ca6afb058adbf5ea9c..cc5bdd1f32dc334e0a4a7974c2ca8d263b27adb8 100644 --- a/crates/theme/src/default_colors.rs +++ b/crates/theme/src/default_colors.rs @@ -177,7 +177,14 @@ impl ThemeColors { vim_visual_block_background: system.transparent, vim_helix_normal_background: system.transparent, vim_helix_select_background: system.transparent, - vim_mode_text: system.transparent, + vim_normal_foreground: system.transparent, + vim_insert_foreground: system.transparent, + vim_replace_foreground: system.transparent, + vim_visual_foreground: system.transparent, + vim_visual_line_foreground: system.transparent, + vim_visual_block_foreground: system.transparent, + vim_helix_normal_foreground: system.transparent, + vim_helix_select_foreground: system.transparent, } } @@ -315,7 +322,14 @@ impl ThemeColors { vim_visual_block_background: system.transparent, vim_helix_normal_background: system.transparent, vim_helix_select_background: system.transparent, - vim_mode_text: system.transparent, + vim_normal_foreground: system.transparent, + vim_insert_foreground: system.transparent, + vim_replace_foreground: system.transparent, + vim_visual_foreground: system.transparent, + vim_visual_line_foreground: system.transparent, + vim_visual_block_foreground: system.transparent, + vim_helix_normal_foreground: system.transparent, + vim_helix_select_foreground: system.transparent, } } } diff --git a/crates/theme/src/fallback_themes.rs b/crates/theme/src/fallback_themes.rs index 6bfcb1c86811136388eb5a557458f88c65d0ac09..3a05040c2b461fc532fb6f69aad2723f648dd557 100644 --- a/crates/theme/src/fallback_themes.rs +++ b/crates/theme/src/fallback_themes.rs @@ -257,7 +257,14 @@ pub(crate) fn zed_default_dark() -> Theme { vim_visual_block_background: SystemColors::default().transparent, vim_helix_normal_background: SystemColors::default().transparent, vim_helix_select_background: SystemColors::default().transparent, - vim_mode_text: SystemColors::default().transparent, + vim_normal_foreground: SystemColors::default().transparent, + vim_insert_foreground: SystemColors::default().transparent, + vim_replace_foreground: SystemColors::default().transparent, + vim_visual_foreground: SystemColors::default().transparent, + vim_visual_line_foreground: SystemColors::default().transparent, + vim_visual_block_foreground: SystemColors::default().transparent, + vim_helix_normal_foreground: SystemColors::default().transparent, + vim_helix_select_foreground: SystemColors::default().transparent, }, status: StatusColors { conflict: yellow, diff --git a/crates/theme/src/schema.rs b/crates/theme/src/schema.rs index f52b2cf0e50bc5d8b26de9457432aba9218a17b9..425dc68e6b28bb3c9ed9c89db9114790aeac4a87 100644 --- a/crates/theme/src/schema.rs +++ b/crates/theme/src/schema.rs @@ -803,8 +803,36 @@ pub fn theme_colors_refinement( .vim_helix_select_background .as_ref() .and_then(|color| try_parse_color(color).ok()), - vim_mode_text: this - .vim_mode_text + vim_normal_foreground: this + .vim_normal_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_insert_foreground: this + .vim_insert_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_replace_foreground: this + .vim_replace_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_visual_foreground: this + .vim_visual_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_visual_line_foreground: this + .vim_visual_line_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_visual_block_foreground: this + .vim_visual_block_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_helix_normal_foreground: this + .vim_helix_normal_foreground + .as_ref() + .and_then(|color| try_parse_color(color).ok()), + vim_helix_select_foreground: this + .vim_helix_select_foreground .as_ref() .and_then(|color| try_parse_color(color).ok()), } diff --git a/crates/theme/src/styles/colors.rs b/crates/theme/src/styles/colors.rs index 905f2245e03ad7a8ce7a4eb8be6799e5ded379c4..b54dc38fdf80665977120cf80c5a15b12b0021a6 100644 --- a/crates/theme/src/styles/colors.rs +++ b/crates/theme/src/styles/colors.rs @@ -179,8 +179,22 @@ pub struct ThemeColors { pub vim_helix_normal_background: Hsla, /// Background color for Vim Helix Select mode indicator. pub vim_helix_select_background: Hsla, - /// Text color for Vim mode indicator label. - pub vim_mode_text: Hsla, + /// Foreground color for Vim Normal mode indicator. + pub vim_normal_foreground: Hsla, + /// Foreground color for Vim Insert mode indicator. + pub vim_insert_foreground: Hsla, + /// Foreground color for Vim Replace mode indicator. + pub vim_replace_foreground: Hsla, + /// Foreground color for Vim Visual mode indicator. + pub vim_visual_foreground: Hsla, + /// Foreground color for Vim Visual Line mode indicator. + pub vim_visual_line_foreground: Hsla, + /// Foreground color for Vim Visual Block mode indicator. + pub vim_visual_block_foreground: Hsla, + /// Foreground color for Vim Helix Normal mode indicator. + pub vim_helix_normal_foreground: Hsla, + /// Foreground color for Vim Helix Select mode indicator. + pub vim_helix_select_foreground: Hsla, // === // Editor diff --git a/crates/vim/src/mode_indicator.rs b/crates/vim/src/mode_indicator.rs index 42d4915fc509e0f373c8d2c5a2a422b74cc84a8f..4660bbfb8290008fb5d65621768af50cde0a6e12 100644 --- a/crates/vim/src/mode_indicator.rs +++ b/crates/vim/src/mode_indicator.rs @@ -100,7 +100,16 @@ impl Render for ModeIndicator { let theme = cx.theme(); let colors = theme.colors(); let system_transparent = gpui::hsla(0.0, 0.0, 0.0, 0.0); - let vim_mode_text = colors.vim_mode_text; + let vim_mode_text = match mode { + crate::state::Mode::Normal => colors.vim_normal_foreground, + crate::state::Mode::Insert => colors.vim_insert_foreground, + crate::state::Mode::Replace => colors.vim_replace_foreground, + crate::state::Mode::Visual => colors.vim_visual_foreground, + crate::state::Mode::VisualLine => colors.vim_visual_line_foreground, + crate::state::Mode::VisualBlock => colors.vim_visual_block_foreground, + crate::state::Mode::HelixNormal => colors.vim_helix_normal_foreground, + crate::state::Mode::HelixSelect => colors.vim_helix_select_foreground, + }; let bg_color = match mode { crate::state::Mode::Normal => colors.vim_normal_background, crate::state::Mode::Insert => colors.vim_insert_background,