Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to spell check a file using vim?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

If you have a spell checker installed on your system, vim will usually find it. If not you will need to install ispell, aspell, hunspell or a similar system as well as support files for the language you want to check.

:set spell

Here is an answer on StackOverflow with keybindings and also a quick little tutorial for usage.

share|improve this answer
    
Also, you can add the :set spell in ~/.vimrc file, so that it will be effective for all the file. –  SHW May 9 '11 at 15:04

If you want to toggle spellcheck on and off, you can add something like the following to your .vimrc:

map <F4> :setlocal spell spelllang=en_gb<CR>
map <F5> :set nospell<CR>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.