Monday, August 06, 2012

Vim spell check with PHP not working

Vim 7.0 has on the fly spell check which can be enabled by using ":set spell". You may also want to use "sell spelllang=en_us" but ":set spell" just works fine for me.

But this on-the-fly spell was not working with my .php files which have the PHP start tags (less than question mark sign). Without the PHP start tags everything was fine.

Here is the workaround to highlight bad spelling in .php file with PHP start tags:

:set filetype=cpp
:set spell

You lose some of the php filetype goodies but now you have the spell check.

I also found that the php filetype was not working for me as the comments environment variable was getting set to HTML comment style (less than exclamation dashes and dashes greater than) .

No comments:

Post a Comment