Vim has a spell checker!
Did you know that? I didn’t.
I just started this blog and I’ve been using Neovim to type my markdown posts. The only thing I felt was missing was a spell checker, so I DDG it up. Turns out Vim and Neovim have had a spell checker since over 10 years. To be fair, I only started using Vim (then Neovim) just a year or 2 ago.
To enable temporary spell check for English do:
:setlocal spell spelllang=en_us
You will then notice a colored wavy line under misspelled words as you would expect from any spell checker. You can navigate through them with ]s
to move to the next and [s
to the previous mistake. You can then do z=
to popup a list of replacement suggestions.
Permanently
You can enable the feature permanently by adding this line to your .vimrc
or vim.init
depending if you use Vim or Neovim:
autocmd BufRead,BufNewFile * setlocal spell spelllang=en_us
Markdown only
I personally only want the spell checker for markdown files so I add this in my .vimrc
/vim.init
instead:
autocmd BufRead,BufNewFile *.md setlocal spell spelllang=en_us
That’s it for now.
I love finding new features out of programs I’ve been using for a while, especially the kind of features that make my life easier.