How to Use Vim's Spellchecker

Tags:

Vim 7 has built in spellchecking. There are two easy ways to turn on spellchecking. If you are using Gvim, you can use Tools > Spelling > Spellcheck On:

vim-spellcheck.png

If you are using Vim in the terminal, or prefer to type, you can turn on spellchecking in Vim with the command :set spell and turn off spellchecking with :set nospell.

Mispelled words will then be underlined in red in Gvim:

vim-spellchecker-highlight.png

Or highlighted in using Vim in the terminal:

vim-spellcheck-highlight-terminal.png

Here are the commands you need to know:

  • ]s — move to the next mispelled word
  • [s — move to the previous mispelled word
  • zg — add a word to the dictionary
  • zug — undo the addition of a word to the dictionary
  • z= — view spelling suggestions for a mispelled word

Here is the Vim spellchecker offering suggestions for the word Nihon:

vim-spellcheck-suggestions.png

That is Vim spell checking in a nutshell. For more commands and documentation, just type :help spell into Vim or read the Vim spell docs online.

Average: 4.8 (27 votes)