As I've writing some TIL posts lately, and I'm doing that using VIM as my main editor for it.
Sometimes I get a little bit worried about typos / wrong spelling as I'm not a native English speaker sometimes I do some silly errors (also on grammar, but that's another post for here hehe)
Vim already have a spell checker that we can set the language like that:
And enable it with
set spell, if we want to have this enabled every time that we open VIM, we need to add the "
set spell" on our
.config/nvim/init.vim for neo Vim
As now we have it enabled, we should be able to use it, so here are some commands that I've been using:
|Command||What does it do|
||It'll open another page with a numbered list of alternatives to that wrong word, you can choose one number of this list and press enter, it'll change the word for the one chosen|
||It moves to the next misspelled word after the cursor|
||It moves to the misspelled word before the cursor|
||Adds the word under the cursor to the dictionary as a "correct word", so it'll not warn next time that you have that word|
Adding spell check per file type
If you want to enable the spell checker automatically based on the type of the file you can add the code below on your
.config/nvim/init.vim for neo Vim.
autocmd BufRead,BufNewFile *.md setlocal spell
This will enable the spell checker only for markdown files, so you won't get errors on some code stuff that it's not really wrong.
If you want to take a deeper look on the spell checker, take a look on the documentation here http://vimdoc.sourceforge.net/htmldoc/spell.html
Hope it helped someone, if you have suggestions or if I did something wrong here, just ping me on Twitter