Vim file specific .vimrc

I want spell checking to be included in vim when editing .txt or .md files. I added

setlocal spell spelllang=en_au 

in .vimrc, but that checks spelling for everything.

+6
source share
3 answers

This can be done using autocmd , although I have never tried:

 autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en_au autocmd BufNewFile,BufRead *.md setlocal spell spelllang=en_au 
+9
source

Well, try enabling spell checking right in vim and not ~ / .vimrc

: set spell

Does he work?

spcific spellchecking language may not work in some cases.

+1
source

This will be what you need in _vimrc.

set spell spelllang=en_us

+1
source

Source: https://habr.com/ru/post/896024/


All Articles