Spell Check

The ability to use spellcheck is actually built right into Neo/vim and as you will see below is actually rather easy to setup.

Setup

First we must create a "spellfile", we can do this by using the following command:

Vim:

:set spellfile=~/.vim/spell/en.utf-8.add

Neovim:

:set spellfile=~/.config/nvim/spell/en.utf-8.add

Next we must tell neo/vim to enable spelling and what language to use. As I am in Britain you will see that reflected in my examples.

Vim:

set spell
set spelllang=en_gb

Neovim:

vim.opt.spell = true
vim.opt.spelllang = 'en_gb'

That is the basic setup complete but there are some optional extras to make your life a little easier, first of all lets set a key-bind so we can toggle the spell checker on and off.

Vim:

nmap <silent> <leader>s :set spell!<cr>

Neovim:

vim.keymap.set('n', '<leader>s', ':set spell!<cr>')

Lastly In neovim you should have an under-curl by default but in vim you wont, so lets set that up:

let &t_Cs = "\e[4:3m"
let &t_Ce = "\e[4:0m"
hi SpellBad   guisp=red    gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl
hi SpellCap   guisp=yellow    gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl

Using the spell checker

To use the spell checker these are the keys you will need to know:

For neovim I would like to recommend the whichkey.nvim plugin, it will allow you to see the word list in a much nicer format. If you don't like it showing up for other things you can disable those functions.