Spell checking in vim

Marco Guazzone marco.guazzone at gmail.com
Sun Aug 23 07:30:45 UTC 2009


On Sat, Aug 22, 2009 at 5:48 PM, Aaron Konstam<akonstam at sbcglobal.net> wrote:
[cut text]

> I am missing something. If you get the file how do you get vim to
> correct the misspelled words?
>>

Once you have the dictionary file in $HOME/.vim/spell (in this case
the file is "de.utf-8.spl") you can spell check inside ViM by issueing
the command:

:setlocal spell spelllang=de

After that ViM will mark (in red for me) all misspelled words in
real-time (i.e. while you're typing).

Since I frequently use this feature I've created some key bindings
inside my $HOME/.vimrc:

map <F5> <Esc>:setlocal nospell<CR>
map <F6> <Esc>:setlocal spell spelllang=en<CR>
map <F7> <Esc>:setlocal spell spelllang=it<CR>

If you want a list of possible candidates of a misspelled word, move
the cursor on that word and (in command mode) type: "z=".
Instead if that word is right (e.g. e technical word) and you want to
insert in the dictionary file type "zg"
If you want to remove a word from a dictionary type "zw".
Finally for moving to the next/previous misspelled word type "]s" and
"[s" respectively.

-- Marco




More information about the fedora-list mailing list