vimtricks.wiki Concise Vim tricks, one at a time.

How do I jump between misspelled words in Vim?

Answer

]s and [s

Explanation

How it works

When spell checking is enabled in Vim with :set spell, misspelled words are highlighted. You can quickly jump between these highlighted words using:

  • ]s moves the cursor forward to the next misspelled word.
  • [s moves the cursor backward to the previous misspelled word.

These motions skip over correctly spelled text and land directly on the next error, making it efficient to review and fix spelling across an entire document without scanning line by line.

Both commands accept a count: 3]s jumps forward three misspelled words at once.

There are also variants that distinguish between types of spelling errors:

  • ]S and [S only jump to words that are truly misspelled (flagged as bad), skipping words that are merely rare or from another region.

Example

Suppose you are editing a Markdown document with spell check enabled:

This is a documnet with severl speling mistakes
that need to be correted before publishing.
  1. Run :set spell to enable spell checking.
  2. Press ]s to jump to the first misspelled word (documnet).
  3. Press z= to see correction suggestions, or type 1z= to accept the first suggestion.
  4. Press ]s to jump to the next misspelled word (severl).
  5. Continue until all errors are fixed.

Useful spell commands

  • z= shows a numbered list of suggested corrections.
  • zg adds the word under the cursor to the spell file (marks it as good).
  • zw marks the word under the cursor as wrong.
  • zug undoes a zg or zw action.
  • :set spelllang=en_us sets the spell language to US English.

Next

How do you yank a single word into a named register?