see the vim help: :help spell-syntax
You can define particular syntax groups as having spell checking.
There's probably a better way to do it (using a ~/.vim/after/syntax/php.vim file?), but a simple hack is to make a personal version of the php syntax file in ~/.vim/syntax (you can do this by doing :e $VIMRUNTIME/syntax/php.vim
and the :saveas ~/.vim/syntax/php.vim
), and change all instances of the text contains=@phpAddStrings
to contains=@Spell,@phpAddStrings
. Next time you open a php file, turn on spell checking as normal with :set spell
.
Michael Dunn
2010-09-07 17:18:46