I am using VOoM (it is probably not needed to know much about it to be able to answer my question, I'm just providing this info for context) and I have managed to write myself a couple of custom syntax highlight rules for specific content.
First, I am using a modeline to tell vim that a certain file is a VOoM outline, I have this at the bottom of such files:
/* vim: set syntax=myvoom : */
Second, I have a /home/user/.vim/after/syntax/myvoom.vim file, here's a snippet from it:
syn match voomTag "^tags:.*"
hi voomTag ctermfg=White ctermbg=Red guifg=White guibg=Red
In some outline nodes I have lines like:
tags: foo, bar, baz
to make the searching easier, the syntax highlight rule above just displays those lines with a custom foreground/background.
This works as expected with default colorscheme (:colorscheme in vim returns 'default').
When I want to try a custom colorscheme (mustang for example) and change it by doing :colorscheme mustang, the syntax highlight for my tag lines is lost.
I would like to understand why this happens.
Also, I would like to learn how to auto-sync these custom syntax rules (which are general, not specific to a certain colorscheme) when the colorscheme is changed. Do I have to check for this explicitly somehow, in myvoom.vim file? Like looking what colorscheme is active and have custom syntax highlight rules for different colorschemes or is there a better approach?