:: krowemoh

Friday | 27 DEC 2024
Posts Links Other About Now

previous
next

Vim Spelling

2022-02-08

I've been using vim for probably a decade at this point but besides the basics, I actually know nothing about vim.

It was only this year that I learned that you can enable spellcheck in vim pretty easily.

:set spell spellang=en_us

Voila! Decent enough spellcheck which fits most of my needs. I would like a grammar checker as well but that might be a bit harder and probably requires looking for a plugin.

The [s and ]s cause the cursor in vim to move to either the previous or next misspelled word. z= will bring up a list suggestions and you can select the correct word by entering the number. zg will add the word to the dictionary which is great. The list of made up words I have added at this point is pretty long!

If you add a word by mistake, you can edit the saved words by going to the file:

~/.vim/spell/en.utf-8.add

This is just a list of words that you've added to the dictionary.

I use the spellchecked specifically in my markdown files, like so:

autocmd BufRead,BufNewFile *.md :set spell spelllang=en_us

It's pretty funny (and sad) that I've been using vim for so long without a lot of things. I didn't even have undos until a couple years ago! Now that is mindblowing.