ArchiveAbout

Kyle Pericak

"It works in my environment"

Created: 2019-10-25Updated: 2019-10-25

Vim Spell-Check

Category:developmentTags:vim;
How to enable, disable, and use spell check in Vim (version >=7).

As of Vim7, spell-checking is a built-in feature.

The spell checker will highlight incorrectly spelled words in red. Light blue highlights indicate words which are only found in another dictionary (such as "color" from en_us).


Commands

Enable/Disable

Enable spellcheck

  • set for all buffers, setlocal for the current one
  • en_ca will use Canadian spelling.
:set spell spelllang=en_ca
:setlocal spell spelllang=en_ca

Or if you're not picky, the spelllang argument can be omitted. I'm not sure what the default is, but I figure it's probable en which uses all the English dictionaries together.

:set spell

Disable spellcheck:

:set nospell

Using Spell-Check

Move to the next misspelled word

]s

previous misspelled word

[s

Highlight a misspelled word. Show possible replacements. Press return with no input to go back.

z=

Accept the spelling of a word:

zg

Mark a word's spelling as wrong

zw
Tags
ansible
Blog code last updated on 2024-02-18: 5ab386de2324c1884556552d0f043a42f2f726ab