How can I set up vim in such a manner, that it spellchecks only the text portion of my file?
I write a lot of reports that include code listings, which I would like to exclude from the spellchecking.
Also I am writing in different languages: german and english.
How do I setup vim to do the spell checking properly. Which spell-checking packages are the best (aspell/ispell/…)?
Best Answer
Vim has built in spell checking. You do not need external spell checkers. Simply use
:set spell
to enable spell checking.To disable spell checking in code listings, you need to modify the vim syntax file for tex. Copy
$VIMRUNTIME/syntax/tex.vim
to$HOME/.vim/syntax/tex.vim
. Around line 402, this file has:Change each of these
@Spell
to@NoSpell
and vim will not spell check in the respective environments.