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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top