Closed laggardkernel closed 5 years ago
This is an awesome compromise between the flexible original approach and your idea in #74 that retains the ongoing maintainability of the current repo. Nice!
Thanks a lot for your contribution and sorry this has been taken into account so late, life has been pretty busy and I must admit that I did not spend much time on this repo. As there was a merge conflict with other pull request I merged the code manually.
@laggardkernel IncSearch doesn't work properly.
Fixed by
- hi! link IncSearch OneHue6
+ call <sid>X('IncSearch', s:hue_6, '', '')
@kevinhwang91 Sorry, haven't used vim for a long time. After some reading, I found the cause
hi {group_name}
inherits existing group and override it, while hi! link
ignore existing group definition and use only its own colorsOnly a quick fix removing problematic hi! link
. Maybe we should drop hi! link
on the default groups (listed in :highlight-default
).
hi clear
clears user defined highlight groups and load some default groups,
IncSearch xxx term=reverse cterm=reverse gui=revers
hi! link IncSearch OneHue6
check :hi IncSearch
IncSearch xxx cterm=reverse gui=reverse
links to OneHue6
The default def is ignored, only linked group is used, so the text (foreground) is OneHue6.
If we use call <sid>X('IncSearch', s:hue_6, '', '')
IncSearch xxx cterm=reverse ctermfg=94 gui=reverse guifg=#986801
Group def is merged with the default one, the background color is OneHue6.
vim-one
converts the color hex code to 256 color code inhighlight
command wrapper function called<sid>X(group, fg, bg, attr)
. The unnecessary calculation in all of its 380+highlight
definitions makesvim-one
one of the slowest vim colorschemes.I realized this from the explanation made by @geoffharcourt at issue #74 . Someone reported the slow startup caused by
vim-one
in issue #84 as well.In my experiment, I removed the conversion, hard-coded the closest 256 color code, defined a new
hi
wrapper for highlight definition. It turns out that this improves the startup time hugely.At the same time, the original
hi
wrapper function<sid>X(group, fg, bg, attr)
is kept for user customization.vim-one
loading timehi
statements directlyThe final result
34 ms
is acceptable, consideringvim-one
uses so manyhighlight
definitions.Credit
highlight
(:help hi
) command wrapper is borrowed from Vim theme oceanic-next.