VIM spell checking by file type

Wish I'd figured out this tweak to .vimrc before:

set spelllang=en
autocmd BufRead,BufNewFile *.md setlocal spell
autocmd BufRead,BufNewFile *.txt setlocal spell
autocmd BufRead,BufNewFile COMMIT_EDITMSG setlocal spell

Getting spell checking in non-text files was just too annoying, so I turned it off.

Haven't come across a vim equivalent of Emacs' flyspell-prog-mode which considers (programming) context before painting your file red, but I haven't looked too hard either. Now at least, I get spell checking in text, markdown and git commit buffers. And not in all other files I open. Pretty neat, me thinks.


~ /home 🏠 ~ talks 💬 ~ bash ~ craftsmanship ~ db ~ dongxi ~ emacs ~ escenic ~ iam ~ java ~ js ~ language ~ latex ~ ldap ~ life ~ linux ~ llm ~ mac-os-x ~ mt-foo ~ network ~ norsk ~ python ~ quotes ~ running ~ security ~ travel ~ unix ~ various ~ vcs ~ webdesign ~ windows ~ discoveries ~ cv 🧙 ~

Licensed under CC BY Creative Commons License ~ 📡 RSS feed ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert