简体   繁体   中英

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.

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

这将是_vimrc中您需要的。

set spell spelllang=en_us

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM