feat: support mini.statusline plugin#336
Conversation
|
@cnjhb Feel free to try out this patch locally and let me know how it looks. |
@adriantrunzo That's fine, |
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 |
It doesn't matter if it's brighter, because the text is black. |
| 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I think this is "just" DraculaNormal, actually.
Do you mean just Normal? I don't see any highlight group called DraculaNormal.
Line 229 in 6b0f9cc
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.
There was a problem hiding this comment.
I think this is "just" DraculaNormal, actually.
Do you mean just
Normal? I don't see any highlight group calledDraculaNormal.
Yep, sorry.
Line 229 in 6b0f9cc
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:
DraculaOrangeInverseandDraculaRedInverse. I assume the inconsistency you'd like to correct is the white text inDraculaRedInverse? Not sure if that white text was for readability reasons, butDraculaRedInverseis 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
-
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. ↩
There was a problem hiding this comment.
If y'all land on a combination that is more accessible, then I'm game to make the change. I trust your judgement @benknoble
There was a problem hiding this comment.
I think black-on-red generally has more contrast than white-on-red. Here's a contrast comparison using the colors from dracula:
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!
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:hfunction.Documentation for the highlight groups: https://github.com/nvim-mini/mini.nvim/blob/cad365c212fb1e332cb93fa8f72697125799d00a/doc/mini-statusline.txt#L48