Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spell check with Vim and XML automatically

Tags:

vim

xml

aspell

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?

like image 584
Scribblemacher Avatar asked Feb 10 '12 21:02

Scribblemacher


1 Answers

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.

like image 127
lucapette Avatar answered Oct 02 '22 12:10

lucapette