nafis
nafis

Reputation: 199

vim file specific .vimrc

I want spell checking to be enabled on vim when editing .txt or .md files. I added

setlocal spell spelllang=en_au

to .vimrc but that did spell checking for everything.

Upvotes: 6

Views: 920

Answers (3)

llinfeng
llinfeng

Reputation: 49

This would be what you need in _vimrc.

set spell spelllang=en_us

Upvotes: 1

coder4
coder4

Reputation: 319

Well, try to enable spell check directly in vim, not ~/.vimrc

:set spell

Does it work?

spcific language spell check may not work in some cases.

Upvotes: 1

kprobst
kprobst

Reputation: 16651

This might be doable with an autocmd though I've never tried it:

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

Upvotes: 9

Related Questions