Skip to content

feat: support mini.statusline plugin#336

Open
adriantrunzo wants to merge 1 commit intodracula:masterfrom
adriantrunzo:mini-statusline
Open

feat: support mini.statusline plugin#336
adriantrunzo wants to merge 1 commit intodracula:masterfrom
adriantrunzo:mini-statusline

Conversation

@adriantrunzo
Copy link
Contributor

@adriantrunzo adriantrunzo commented Mar 6, 2026

Fixes #335

I've been using the mini.statusline plugin for quite some time now and these changes are directly from my local fork of dracula/vim. I've replicated the vim-airline theme colors as closely as possible because that's how I've set up my status line, but there may be room for improvement. The airline theme seems like a good base line.

We don't have a consistent set of existing highlight groups to link to for these combinations, so I've reused the local s:h function.

Documentation for the highlight groups: https://github.com/nvim-mini/mini.nvim/blob/cad365c212fb1e332cb93fa8f72697125799d00a/doc/mini-statusline.txt#L48


Screenshot 2026-03-05 at 9 41 35 PM Screenshot 2026-03-05 at 9 42 15 PM Screenshot 2026-03-05 at 9 42 40 PM Screenshot 2026-03-05 at 9 43 19 PM Screenshot 2026-03-05 at 9 45 55 PM

@adriantrunzo
Copy link
Contributor Author

@cnjhb Feel free to try out this patch locally and let me know how it looks.

@cnjhb
Copy link

cnjhb commented Mar 6, 2026

@cnjhb Feel free to try out this patch locally and let me know how it looks.

@adriantrunzo That's fine,
but wouldn't it be better to use different colors for command mode and normal mode?

@adriantrunzo
Copy link
Contributor Author

but wouldn't it be better to use different colors for command mode and normal mode?

Good question. It looks like the existing airline and lightline themes don't specify a separate color for command mode. Nor do I think airline supports a different color for command mode: https://github.com/vim-airline/vim-airline/blob/4ab7c731fe64672412fbe0723831928785c84931/autoload/airline/themes/dark.vim#L16.

Do you have any suggestions about which color to use? We haven't used Cyan or Pink, but they may be too bright? Red would look like an error.

To play it safe, we could just match airline and let people customize the MiniStatuslineModeCommand highlight group in their nvim configuration.

@cnjhb
Copy link

cnjhb commented Mar 7, 2026

but wouldn't it be better to use different colors for command mode and normal mode?

Good question. It looks like the existing airline and lightline themes don't specify a separate color for command mode. Nor do I think airline supports a different color for command mode: https://github.com/vim-airline/vim-airline/blob/4ab7c731fe64672412fbe0723831928785c84931/autoload/airline/themes/dark.vim#L16.

Do you have any suggestions about which color to use? We haven't used Cyan or Pink, but they may be too bright? Red would look like an error.

To play it safe, we could just match airline and let people customize the MiniStatuslineModeCommand highlight group in their nvim configuration.

It doesn't matter if it's brighter, because the text is black.
The colors in both visual mode and insert mode are quite bright and look quite suitable.

Comment on lines +1056 to +1065
call s:h("MiniStatuslineDevInfo", s:fg, s:bg)
call s:h("MiniStatuslineFileInfo", s:fg, s:comment)
call s:h("MiniStatuslineFilename", s:fg, s:selection)
call s:h("MiniStatuslineInactive", s:fg, s:selection)
call s:h("MiniStatuslineModeCommand", s:bg, s:purple)
call s:h("MiniStatuslineModeInsert", s:bg, s:green)
call s:h("MiniStatuslineModeNormal", s:bg, s:purple)
call s:h("MiniStatuslineModeOther", s:bg, s:green)
call s:h("MiniStatuslineModeReplace", s:bg, s:orange)
call s:h("MiniStatuslineModeVisual", s:bg, s:yellow)
Copy link
Member

Choose a reason for hiding this comment

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

  call s:h("MiniStatuslineDevInfo", s:fg, s:bg)

I think this is "just" DraculaNormal, actually.

  call s:h("MiniStatuslineFileInfo", s:fg, s:comment)
  call s:h("MiniStatuslineFilename", s:fg, s:selection)
  call s:h("MiniStatuslineInactive", s:fg, s:selection)

We have s:bglighter, s:bglight for things like this, too. See how StatusLine and StatusLineNC are defined.

  call s:h("MiniStatuslineModeCommand", s:bg, s:purple)
  call s:h("MiniStatuslineModeInsert", s:bg, s:green)
  call s:h("MiniStatuslineModeNormal", s:bg, s:purple)
  call s:h("MiniStatuslineModeOther", s:bg, s:green)
  call s:h("MiniStatuslineModeReplace", s:bg, s:orange)
  call s:h("MiniStatuslineModeVisual", s:bg, s:yellow)

We have a few "Inverse" colors, but they inconsistently put text in foreground or background colors. (We also inconsistently use the "inverse" attribute.) Perhaps as a preliminary step we should first cleanup these inconsistencies; then, introduce inverse colors for our palette; then, use them here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is "just" DraculaNormal, actually.

Do you mean just Normal? I don't see any highlight group called DraculaNormal.

call s:h('Normal', s:fg, g:dracula_colorterm || has('gui_running') ? s:bg : s:none )

We have s:bglighter, s:bglight for things like this, too. See how StatusLine and StatusLineNC are defined.

Ok, I'll take a look at switching to these groups.

We have a few "Inverse" colors, but they inconsistently put text in foreground or background colors.

I see exactly two: DraculaOrangeInverse and DraculaRedInverse. I assume the inconsistency you'd like to correct is the white text in DraculaRedInverse? Not sure if that white text was for readability reasons, but DraculaRedInverse is only used in one place, so this change shouldn't be too disruptive.

Perhaps as a preliminary step we should first cleanup these inconsistencies; then, introduce inverse colors for our palette; then, use them here?

Sounds good, I'm happy to tackle this refactor.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is "just" DraculaNormal, actually.

Do you mean just Normal? I don't see any highlight group called DraculaNormal.

Yep, sorry.

call s:h('Normal', s:fg, g:dracula_colorterm || has('gui_running') ? s:bg : s:none )

We have s:bglighter, s:bglight for things like this, too. See how StatusLine and StatusLineNC are defined.

Ok, I'll take a look at switching to these groups.

We have a few "Inverse" colors, but they inconsistently put text in foreground or background colors.

I see exactly two: DraculaOrangeInverse and DraculaRedInverse. I assume the inconsistency you'd like to correct is the white text in DraculaRedInverse? Not sure if that white text was for readability reasons, but DraculaRedInverse is only used in one place, so this change shouldn't be too disruptive.

Yeah. I don't know why it's white-on-red either, but I don't find it too readable now that I'm looking at it1. It gets used for the standard ErrorMsg, but I think that might be more readable with s:bg as the text color (I find it so in a short test).

(There's also a "green inverse" but it might not have a name other than DraculaSearch.)

The other "inconsistency" is whether they use s:attrs.inverse or just swap fg/bg in s:h(). If you don't mess with that, it's fine, but it might be nice to clean up some day.

Perhaps as a preliminary step we should first cleanup these inconsistencies; then, introduce inverse colors for our palette; then, use them here?

Sounds good, I'm happy to tackle this refactor.

Much appreciated!

Footnotes

  1. This goes all the way back to that massive refactor we (@dsifford) did in Massive theme overhaul #62; I haven't tried blaming within that PR for now.

Copy link
Member

Choose a reason for hiding this comment

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

If y'all land on a combination that is more accessible, then I'm game to make the change. I trust your judgement @benknoble

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think black-on-red generally has more contrast than white-on-red. Here's a contrast comparison using the colors from dracula:

Screenshot 2026-03-11 at 4 42 18 PM Screenshot 2026-03-11 at 4 44 21 PM

Screenshots from https://color.adobe.com/create/color-contrast-analyzer.

(There's also a "green inverse" but it might not have a name other than DraculaSearch.)

Ah, thanks!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Can we support mini.statusline?

4 participants