This is an article from a past blog.
Better texts with a little effort#
Did you know Vim has a built-in spellchecker? In this short howto i will show you how to use this.
How does this work?#
To start, open the document you want to check. By default the spell checker is disabled, so we must turn it on.
Run the following command to enable English spelling
:set spell spelllang=en
Now some key combo’s will become available
Key | Purpose |
---|---|
[S | Jump to the next faulty word |
]S | Jump to the previous faulty word |
Z= | Display replacement suggestions for the highlighted word |
zg | Teach Vim the word, add it to the wordlist |
Bonus#
If you want, you can enable the spell checker every time you start Vim so you don’t have to do it manually. At startup Vim reads the .vimrc
file. This file contains instructions about what to load at startup.
filetype on
filetype plugin on
filetype indent on " file type based indention
autocmd FileType text call s:enable_spelling()
autocmd FileType markdown call s:enable_spelling()
function! s:enable_spelling()
set wrap!
set spell spelllang=en
endfunction