Skip to content

Conversation

@willeyh-git
Copy link
Contributor

Closes #14093
Builds on #32279 by making it theme dependent.
Discussion #37816

Wraps the mode label indicator in a div and makes the wrapper and label theme-able. Label weight to medium
Mode indicator will render like previously if not theme colors have been set. (i.e., they match zed default- and fallbacks)
Really helps with visual confirmation of current mode.

Did not investigate further if there is a way to keep the leading and trailing -- if no theme var given.

Can be applied either by a theme itself or using theme_overrides in settings.json

Theme colors applied via theme_overrides
Screenshot 2025-10-08 at 23 01 08
Screenshot 2025-10-08 at 23 01 16
Screenshot 2025-10-08 at 23 01 23

No theme applied
Screenshot 2025-10-08 at 23 01 31
Screenshot 2025-10-08 at 23 01 36
Screenshot 2025-10-08 at 23 01 40

vimmodes.mov

Release Notes:

  • Vim make mode indicator themeable

@cla-bot
Copy link

cla-bot bot commented Oct 8, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @WillyHetland on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@willeyh-git
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 8, 2025
@cla-bot
Copy link

cla-bot bot commented Oct 8, 2025

The cla-bot has been summoned, and re-checked this pull request!

pub struct ThemeColorsContent {
/// Background color for Vim Normal mode indicator.
#[serde(rename = "vim.normal.background")]
pub vim_normal_background: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move these to the bottom of the struct.

@ConradIrwin
Copy link
Member

Thanks for this!

I like this approach much better than re-using the git status colors; but I'm still concerned about the default un-themed version. Is there a way to build this where the padding doesn't look wrong if the colors are not set (Which will be the default)?

I'm not sure we need the --, but in your screenshots the version with the color looks spaced correctly, and the version with no colors looks too gappy.

I'm also not thrilled by how many variables a theme would have to set to use this, but I think that reflects reality somewhat...

@willeyh-git
Copy link
Contributor Author

I'm not sure we need the --, but in your screenshots the version with the color looks spaced correctly, and the version with no colors looks too gappy.

Seems like it can be done if we go by the assumption that a background color system_transparent, which is the default color for every mode, is set.
Screenshot 2025-10-14 at 22 24 22

If no color is set for the given mode:

  • leading and trailing -- are rendered, horizontal padding is removed and text color is reverted to default.

@zed-industries-bot
Copy link

zed-industries-bot commented Oct 16, 2025

Messages
📖

This PR includes links to the following GitHub Issues: #14093
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against 2b8b97e

@ConradIrwin
Copy link
Member

Thanks. It's a bit odd to have the theme change the content, but I think it's the best compromise in this case (until we figure out a better one :D).

Would you mind making the CI happy?

@ConradIrwin ConradIrwin enabled auto-merge (squash) October 21, 2025 04:12
@ConradIrwin
Copy link
Member

I spent a bit more time tidying this up:

  • Pending keystrokes (and ctrl-g output) are not rendered in the colored mode indicator
  • The indicator's background now is the same size as the buttons its rendered alongside for themes where buttons are not invisible

@ConradIrwin ConradIrwin merged commit 71ea133 into zed-industries:main Oct 21, 2025
21 checks passed
@willeyh-git willeyh-git deleted the vimModeWrapper branch October 21, 2025 06:17
@0x2CA
Copy link
Contributor

0x2CA commented Oct 28, 2025

I'm not sure if this error was caused by this change.

If you force quit the app, reopening it will retain the insertion mode.

2025-10-28.08.46.35.mov

@willeyh-git
Copy link
Contributor Author

I'm not sure if this error was caused by this change.

If you force quit the app, reopening it will retain the insertion mode.

Can be replicated in the current release. Don't think its related to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I want to visualize vim status mode.

8 participants