Spell Checking
Built-in spell checker with per-language dictionaries.
Vim ships with a real spell checker. Toggle it with :set spell, jump misspellings with [s/]s, suggest fixes with z=, add words to a personal dictionary with zg.
Vim has a real spell checker built in โ not an after-thought, not a plugin. Turn it on with :set spell, and misspelled words get a wavy underline (or whatever your spell highlight defines).
Toggle and language
| Command | Effect |
|---|---|
:set spell |
Turn spell checking on for the current buffer |
:set nospell |
Turn it off |
:setlocal spell! |
Toggle, only for this buffer |
:set spelllang=en_us |
Use the US English dictionary |
:set spelllang=en_us,de_de |
Spell check against multiple languages at once |
Move between misspellings
| Key | Note |
|---|---|
| {key:]}{key:s} | Jump to the next misspelled word |
| {key:[}{key:s} | Jump to the previous misspelled word |
| {key:]}{key:S} | Same as ]s but only flag bad words (skip rare/regional) |
| {key:[}{key:S} | Same as [s but only flag bad words |
Fix and learn
| Key | Note |
|---|---|
| {key:z}{key:=} | Show suggestions for the word under cursor (numbered list, type a digit + Enter) |
| {key:z}{key:g} | Good word โ add to your personal dictionary (file at spellfile) |
| {key:z}{key:w} | Wrong word โ mark as misspelled in your personal dictionary |
| {key:z}{key:u}{key:g} | Undo a previous zg |
| {key:z}{key:u}{key:w} | Undo a previous zw |
See also: The z Family, The [ and ] Family