Fabien Meghazi wrote:
> Hi all,
> I would like to add to rules in my vimrc but I don't know how to do this :
> I would like all xmlTagName "books" to be highlighted in a different
> way than other tags
> I would like all xmlAttrib "name" to be highlighted in a different way
> than other attributes.
For this, you should add syntax rules in (on Unix) ~/.vim/after/syntax/xml.vim
or (on Windows and most other systems) ~/vimfiles/after/syntax/xml.vim (Create
the file if it doesn't exist, as well as any not-yet-existing directories.)
> I know that I should use syn match , syn cluster , hi link, etc.. but
> I don't understand how to use them.
sy keyword xmlTagNameBooks books containedin=xmlTagName
sy match xmlAttribName /\<name=/ containedin=xmlAttrib
hi default link xmlTagNameBooks xmlTagName
hi default link xmlAttribName xmlAttrib
then add different ":hi" statements for xmlTagNameBooks and xmlAttribName in
your favourite home-brewed colourscheme (or in your vimrc if you don't have one).
> I tried to understand syntax/html.vim and :he syn but my brain must be
> too small for that.
> Does someone knows a document or something explaining vim hililghting
> rules for human reading ?
Read it slowly with a full coffeepot at hand when you have all your time, no
headache, no babble-spouting television, and no children running around you
playing cat-and-mouse. It may help to compare with
$VIMRUNTIME/syntax/<something>.vim where <something> is a not-too-complex
language well known to you.
Polymer physicists are into chains.
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php