views:

91

answers:

1

Hi folks, I'm a long time vim user, but only recently learned that vim7 has some awesome spelling features baked in now. I've been using all sorts of external spelling tools and plugins so far, and am very excited about ditching all of them for the builtin spelling.

So here's the problem. I did review :help spell and the spelling looks great for most of the filetypes I've tried, except perl (.pl|.pm). The problem seems syntax related because when I :set spell and set syntax=off the spelling works fine, but then stops working when I set syntax=perl.

What would be really cool, is if I could enable the spelling for only for the POD blocks. Any ideas?

:set spell
:set spelllang=en_us
:set syntax=perl
+2  A: 

grepping for “spell” in /usr/share/vim/vim72/syntax/perl.vim, I find some syntax definitions for POD that already include spelling, but are wrapped in an include guard for perl_include_pod. At the top of perl.vim, the default variables are given, and perl_include_pod is unlet by default.

So adding

let perl_include_pod = 1

to ~/.vimrc turns on syntax highlighting, with spell-check, inside POD portions of perl files.

andrew
Awesome, that works. I kinda like the coloring better without perl_include_pod, so I changed it a bit. Thanks for pointing me to the right place.
Ajith Antony