Question

When vim checks the spelling of XML documents, it seems to default to checking attributes etc, but not the text between tags. This can easily be fixed by running these two commands:

:syn spell toplevel
:redraw

I'd like Vim to to do this by default. However, adding these two commands to my vimrc seems to have no affect; they must be performed manually every time I start Vim. Is there another way to make Vim check the spelling between XML tags by default?

Was it helpful?

Solution

Add an xml.vim file in your ~/.vim/after/syntax directory and put syn spell toplevel in it. It should be enough. See :h mysyntaxfile-add for further information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top