On Wed, 13 May 09 at 1347 -0700, Michael Repucci wrote:
>
> Hi Vimmers,
>
> I'm relatively new to Vim, and having some trouble with the spell
> check. I set spell checking on in my ~/.vimrc with the line "set spell
> spelllang=en_us" (without quotes). This works fabulously for certain
> files (e.g., *, *.c, *.m), but not for others (e.g., *.sh, *.html).
> I'm a bit baffled, because I didn't think Vim would choose to apply
> the spell checking to files based on file extension, and I can't seem
> to find anything about this in the help. Does anyone know what's going
> on?
>
Though this doesn't answer your question about how to turn on spell check
based on file extension, I have found this useful. Add the below function
to your .vimrc file and you can simply toggle spell check on or off with F4.
Hope this helps.
Cheers, JJ
" Spell Check
function! ToggleSpell( )
if !exists("b:spell")
setlocal spell spelllang=en_us
let b:spell = 1
else
setlocal nospell
unlet b:spell
endif
endfunction
nmap <F4> :call ToggleSpell( )<CR>
imap <F4> <ESC>:call ToggleSpell( )<CR>a
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---