tl;dr
Are there any undesirable side-effects connected to the use of :highlight! default link {from-group} {to-group}
as compared to :highlight default …
that I should be aware of when editing/creating a syntax file?
Director's cut
In the context of trying to understand how syntax highlighting works in Vim, I tend to have opened the syntax file for a given language and a sample of code written in that language, so that I can see the effects on the latter of editing the former simply by sourcing
my .vimrc
.
However, I have seen that some type of edit is not reflected unless I open the file in another session of Vim.
For example, I changed this line in sed.vim
hi def link sedError Error
to this
hi def link sedError NONE
and then source
d my .vimrc
in a flawed file.sed
I had open beside; I saw the Error
highlight disappear. This is what I expected. Then I restored the line above as it was, sourced my .vimrc
again, but the color did not come back.
Based on what I read in :h :hi-link
, it seems I could simply add !
to the hi
light command; I have tried, and it works.
However, I have observed that only fortran.vim
and chicken.vim
make links like this
hi! def link fortranTypeR fortranType
whereas all other syntax files use something like this (from cpp.vim
)
hi def link cppBoolean Boolean
therefore I started suspecting that there could be something not advisable in using hi!
instead of hi
in this situation.