Open laggardkernel opened 5 years ago
Thanks for this PR, although I'd like to open a discussion on this one. Even though hi link
is faster (don't know exactly why), it has a side effect that persists the color if the user changes to another theme and if this theme does not override the setting.
In my mind that would make this colorscheme not a very good Vim citizen, what are your thoughts?
Is it worth saving 15ms?
hi link
is faster because it avoids calling the custom X
function to define highlight
, saves the time cost on call <sid>X
. After some reading on :h hi
, I can confirm you're right about the side effect, hi clear
doesn't clear the hi link
s.
Before you mentioned the side effect, I am not aware of it. In fact, I always use the vim-one
light theme and don't have a workflow of switching to another colorscheme at all. After skimming the codes in Gruvbox, it turns out the maintainers of gruvbox don't realize the problem neither. Or they just ignored it.
But, you're right. Saving 15ms is not a big thing, at least in case there's an SSD on your machine. Using the hi link
or not is totally okay with me. I'd like to know how others think about it.
hi link
reduces loading time from33.6
ms to18.3
ms. This idea is borrowed from vim theme gruvbox.Force link
hi! link
is needed to override default settings, otherwise warning messages will be popped up during theme loading.