Closed adriantrunzo closed 6 months ago
For plugin groups that are set using after/plugin
(which I argued against, IIRC), you probably need to put your own after/plugin/XXX.vim
script that does something like
if g:colors_name ==# 'dracula'
" your highlight changes
endif
Of course note that these plugin files will not be automatically re-sourced when you call :colorscheme
.
See even more challenges linked in https://github.com/dracula/vim/pull/85 (where I do, in fact, suggest that after
is a bad idea for a colorscheme).
@dsifford: is time to revisit after
?
https://github.com/dracula/vim/issues/280 also seems related, though I'm trying to page back in a lot of context on that one.
Is this still true? https://github.com/dracula/vim/issues/280#issuecomment-1096780618
The /after was necessary because some plugins tend to overwrite things that are set in the main colors file.
@adriantrunzo this might work to resolve the "what happens if I :colorscheme
again" issue https://github.com/dracula/vim/issues/280#issuecomment-1096937219 but it's kind of a hack
@benknoble happy to revisit if you feel like you've got the bandwidth
😅 Frankly my plate is overfull at the moment. I will try to carve out some time to take a stab at this, but any context on how we got here would be useful. Something about other plugins not cooperating??
@benknoble Thanks for the info and I'm happy to help out with any changes and/or testing. I was, in fact, going to fork this repository and just dump all of the highlight logic from /after
into /colors/dracula.vim
following examples like https://github.com/nordtheme/vim/blob/main/colors/nord.vim. I can still do that and test it out.
@benknoble Thanks for the info and I'm happy to help out with any changes and/or testing. I was, in fact, going to fork this repository and just dump all of the highlight logic from
/after
into/colors/dracula.vim
following examples like https://github.com/nordtheme/vim/blob/main/colors/nord.vim. I can still do that and test it out.
That would be very helpful. I expect there will be some problems; in particular, you'll need to test with the relevant plugins to see what happens. Before/after matters to make sure the colors make sense.
The context for the after was there is a mixed bag of random plugins that overwrite highlight groups and cause the highlighting to look non-uniform. The after approach was just us telling those plugins, "no, don't do that" and overwriting their overwrites.
I've removed the after
directory in my fork: https://github.com/adriantrunzo/dracula-vim/tree/no-after.
I haven't run into any issues yet in my setup, but I'll continue to test out the changes over the coming week. I can confirm that the change solves my recurring issues of not being able to source my vimrc without losing highlights and not being able to easily overwrite highlight links.
in particular, you'll need to test with the relevant plugins to see what happens. Before/after matters to make sure the colors make sense.
Sure, visual regression tests make sense. I am not sure what your expectations are, but I can try the following:
/after/syntax
/after/plugin
I'll have to dust off my Neovim install.. I suppose you'd want to see comparisons for Vim and Neovim separately.
That sounds great! If you can't cover it all, that's fine, too. But your help on this is much appreciated (by me, at least, who really doesn't have the time for all those things 😅).
@benknoble @dsifford I haven't noticed any issues over the past 2 weeks while using my fork. I've opened a draft pull request #321 and started taking before/after screenshots. Please let me know if I am on the right path before I go on taking screenshots.
I'll take a look. I'll also try to get your branch checked out on my machines to see how it runs.
What happened
I would like to overwrite the highlight group for GitGutterDelete that is linked in /after/plugin/dracula.vim: https://github.com/dracula/vim/blob/9fa89296884e47bbadc49ad959e37b9d1c24cafb/after/plugin/dracula.vim#L48
Note I just want to change GitGutterDelete, not DiffDelete.
Following the docs, I put my customization in a ColorScheme autocommand like so (near the top of my vimrc, before calling
colorscheme dracula
):No matter what I try (with or without the bang !), the highlight group linked in the dracula plugin takes precedence:
What am I missing? I assume the issue is that the dracula plugin puts files in
/after
, which is loaded after the vimrc, and useshi! link
.To reproduce my setup:
:verbose hi GitGutterDelete
What I expected to happen
I expect the output of
:verbose hi GitGutterDelete
to showGitGutterDelete xxx links to DraculaRed
.Screenshot
Machine Info
vim
/gvim
/neovim
): vimTERM
environment variable: xterm-kittyAdditional Info