It looks like you're extending arbitrary syntaxes with your myExCapitalWords
group. Whether / in which syntax items that works depends on the underlying syntax. Unfortunately, it is not possible to extend arbitrary syntaxes in a blanket way. That's why you're seeing problems that can only be solved via :syn clear
(which gets rid of the underlying syntax).
A syntax contains multiple groups, some of which are usually contained=
in others. If you introduce a new syntax, it will only apply to where no other syntax group already matches. You can force your group into others via containedin=TOP
or even containedin=ALL
, but that overlay may prevent other original groups from matching, and causes strange effects because their own contains=
or nextgroup=
now don't apply.
So, unfortunately, there's no general solution for this. If you're only interested in a few syntaxes, you can tweak your one-liner to make it cooperate with the underlying syntax (e.g. try containedin={syntaxName}Comment{s}
), but there's no generally applicable solution.