-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The new default colorscheme breaks legacy vim colorscheme: workarounds and future steps? #26378
Comments
We should fix the bundled colorschemes, as these are useful and maintained (e.g., by adding a |
This comment was marked as resolved.
This comment was marked as resolved.
This is false; nobody is moving anybody away from anything. We just don't consider spending effort on unmaintained external projects worthwhile.
No, we should strive for the minimally invasive fix for the bundled(!) colorschemes. We already need to modify the boilerplate at the top due to different Also, can you please show some before/after screenshots showing bundled (habamax, retrobox, quiet, etc.) colorschemes? I haven't noticed anything from my (admittedly brief) testing. |
Thanks for this detailed issue! I think that the core issue of the new default color scheme being breaking is not really fixable. There are these main culprits:
I don't really agree on My initial suggestion for the users of "old" non-built-in color schemes is to patch the highlight groups which differ from Vim's default behavior. There won't be many. Mostly because this is already the case with Neovim-specific highlight groups ( For built-in color schemes (retrobox, habax, etc.) Neovim maintainers should update them. But as far as I can tell by the their code, they all define every highlight group explicitly (as color scheme plugins should, in my opinion, if they want stability). Would you mind pointing at exact difference? |
This was deliberate for backward compatibility, though. (Not saying we need to keep these forever, mind you, and now may be a good time for dropping it.)
No, I don't think so (beyond adding standard boilerplate to account for technical differences). They are maintained by vim/colorschemes (and very well so, as you mention) and we don't want to fork them. |
Resolution
|
neovim nightly changes Ref: neovim/neovim#26378 Ref: ellisonleao/gruvbox.nvim#307
Neovim 0.10 changes the default color scheme and others highlighting groups different from Vim. Therefore, source the old vim colorscheme before vim.one defines any highlights. See <neovim/neovim#26378> for more information.
Neovim 0.10 changes the default color scheme and others highlighting groups different from Vim. Therefore, source the old vim colorscheme before vim.one defines any highlights. See <neovim/neovim#26378> for more information.
The compatibility issue with most probable cause and suggested solutions are now mentioned in the breaking changes and difference to Vim. |
Neovim 0.10 changes the default color scheme and others highlighting groups different from Vim. Therefore, source the old vim colorscheme before vim.one defines any highlights. See <neovim/neovim#26378> for more information.
Neovim 0.10 changes the default color scheme and others highlighting groups different from Vim. Therefore, source the old vim colorscheme before vim.one defines any highlights. See <neovim/neovim#26378> for more information.
Is there an exhaustive list somewhere? |
or check |
More in the same context, is there some example that uses all the values that you can actually open and check how it looks? I.e. I'd like to troubleshoot vim-gotham theme by comparing old and new look side by side. If someone made a comprehensive example with all the definitions used, that would expose all the regressions. |
The help pages I linked actually use the corresponding highlight groups to color the group name, for that exact purpose. |
Perfect, I'll use that to compare. It works as a comparison at least for those ones which aren't new. |
Slightly off-topic, but where is the definition of the new default color scheme? I.e. if I wanted to convert one from vimscript to lua, what can I look at as the stock example that defines all groups? |
highlight_groups.c |
Well, I want a lua example to make a theme. .c doesn't sound like it. So default theme isn't even defined in lua? Is the fallback one a sufficient / good example? I.e. https://github.com/neovim/neovim/blob/master/runtime/colors/vim.lua |
Yes, the default theme is not defined in Lua but in C. (That's how it is the default.) Please ask usage questions in discussions or on Matrix. |
First of all, I appreciate the huge efforts and work done in the new default colorscheme #26334, it's a great feature and nice enhancement of neovim.
I hope this can be a follow-up thread as a part of the tracking issue #26369, about the awesome new default colorscheme introduced in #26334. Initiated from my reddit comment:
Description of the problem
One issue I have is that the new default colorscheme to break many existing legacy colorschemes that are based on the plain "vim" colorscheme. Those legacy colorschemes --- including those are "shipped with neovim" and community-maintained collections or curations --- are affected and now look quite different because they did not exhaustively define all the highlight group being used, i.e. because of their implicit dependency/assumptions on the default (vim) colorscheme.
Colorschemes usually have
hi clear
at the beginning of the script file, but this reverts all the highlight configs back to the new neovim default; so having some lines like:colorscheme vim
or:source colors/vim.vim early
in init.vim will have no effect. These lines must be put afterhi clear
in each of the colorscheme script.For example, if a colorscheme does not explicitly define "String" as
:hi link String Constant
(which used to default to "Constant" -> "Red"), this will no longer have a highlight color same as "Constant" but "NvimLightGreen". This is a problem of a legacy, outdated colorscheme, so shouldn't be a major problem or blocker, but we might have some decisions or suggested solutions for those legacy colorschemes.Also, the built-in colorschemes https://github.com/neovim/neovim/tree/master/runtime/colors would need an corresponding update or a removal.
Workaround or solutions
On an end user's side:
(1) Users should avoid using legacy vim colorschemes, and move to the modern, neovim-aware plugins that have a continued neovim support.
(2) An user whose config is unfortunately based on an "old" vim colorscheme (say
base_legacy
) can copy (or "fork")colors/base_legacy.vim
into their neovim config and add thesource colors/vim.vim
line afterhi clear
). Sorry, you can't use a plugin any longer unless it is still maintained.(3) Update your existing colorscheme or config to explicitly configure all the built-in highlight groups, that behave differently e.g.
WinSeparator
,String
,Function
,MoreMsg
,WarningMsg
, etc.Community/plugin:
Neovim side:
(5) Add a backward-compatibility option for
hi clear
to allow an user to explicitly opt out of the new default colorscheme; e.g. if some switch is turned on,hi clear
will revert to (or source) thevim
colorscheme. Or, if:colorscheme vim
is ever called once in user'sinit.vim
orinit.lua
,hi clear
will revert to thevim
colorscheme instead of the new neovim default.Since this is only to support an old vim legacy, I'm not sure if it is really worth doing to add a new flag or configuration point. But I don't see any other solutions that can make legacy vim colorschemes look exactly the same without changing the behavior of
hi clear
.The text was updated successfully, but these errors were encountered: