I'm finally getting around to upgrading from Vim 7.4 to Vim 8.1, but my global custom highlight colors have stopped working.
8.1 from the jonathonf/vim ppa repository on Ubuntu 18.04.
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 22 2018 11:42:48) Included patches: 1-346 Modified by [email protected]
Minimum steps to reproduce
Create the following
echo "Read the correct vimrc" hi Comment ctermfg=green cterm=none
Edit any file with comments; "Read the correct vimrc" is displayed, but the comment color is not green.
Additionally, sometimes I can see the color change a few milliseconds after the file is opened, suggesting something may indeed be overriding my settings.
:hi Comment ... from within vim works as expected.
-u .vimrc does not make a difference.
Other things I've tried
I've tried using the
autocmd suggestion from the above linked answer, to no avail. In short, that looks something like this:
augroup customhighlight autocmd! autocmd ColorScheme * hi Comment ctermfg=green augroup end
I then went down the rabbit hole of vimrc defaults:
system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim"
Unfortunately, unless I missed something, there doesn't appear to be anything in the default/Debian vim defaults that would override a user
.vimrc, and, indeed, that would be silly.
I have not gone down the route of implementing custom color schemes, which was another suggestion. Reason being, I work with a lot of different filetypes on a regular basis, and there has always been a way to globally customize colors, so I'm hoping there's a solution.
:verbose hi Comment reports:
Comment xxx term=bold ctermfg=14 guifg=#80a0ff Last set from /usr/share/vim/vim81/syntax/syncolor.vim
What is the best practice to set global syntax highlight color preferences in Vim 8.x?