TIL about vim’s spellcheck
⭐️ a blog post
I’ve been using vim for years, but I’ve never took the time to learn how to do spellcheck. Instead I always open [iA Writer][] if I need spellcheck. However, I have made way too many spelling errors in code comments or quick files and today I decided to learn how to check the spelling of a document.
Today I added this to my .vimrc
:
" spellcheck
command Sp setlocal spell spelllang=en_us
command Spoff setlocal nospell
I only want spellcheck to be on in a single buffer at a time and not by default. After it’s enabled one uses ]s
and [s
to navigate to the next and previous spelling error. With the cursor inside a problem one can use z=
to bring up a list of suggestions for replacement. It’s been great. Below is a screenshot of this file for example.
![Screenshot of this document in vim with spellcheck turned on](https://nathanherald.com/posts/til/vim-spellcheck/screenshot@2x_hu68fcffa6458b2a3f49ad18a73b25d32f_141574_2400x2400_fit_q40_box_3.png)