These are short instructions for setting up the Vim or Gvim editor to do spellchecking. A Unix-type shell is assumed.
Create a subdirectory of your .vim directory to hold the local dictionary of new words:
mkdir -p ~/.vim/spell
Add the following lines to your ~/.vimrc file. Change the en parts if you are spellchecking some language other than English:
set spelllang=en set spellfile=$HOME/.vim/spell/en.utf-8.add
After these steps Vim is set up for spellchecking. Open a text file in Vim. Now these commands are available:
Command | Action |
---|---|
:setlocal spell | Turn on spellchecking. |
:set nospell | Turn off spellchecking. |
]s | Goto next misspelled word. |
[s | Goto previous misspelled word. |
zg | Add the current “good” word to your local dictionary. |
z= | Suggest spellings (choose a number or hit enter for none). |
zw | Mark the current word as wrong. |
zug | Remove the current word from your local dictionary. |
The misspelled words should be highlighted when spellchecking is turned on.
Leave any comments below.
comments powered by Disqus