I have the following in my
~/vim/syntax/xrc.vim to spell check contents of specific tags when editing XRC files that are just XML files with predefined schema:
runtime syntax/xml.vim " check spelling for the user-visible strings. syn region xrcString matchgroup=xmlTagName start="<\z(label\|text\|tooltip\|value\)>" end="</\z1>" contains=xmlEntity,@Spell " and also highlight them as such. hi link xrcString xmlString
and it works without problems -- as long as I don't also try doing
If I enable syntax folding for XML, my region definition is not taken into account any longer (at least not with Vim 8.2). It seems to be due to the different
xmlRegion definition in this case in Vim own
syntax/xml.vim, but I'm not really sure.
Ideally I'd like to have both folding and spell checking for my tags. Does anybody know how to do this?