Vim: run some command when editing a specific file

I want my Vim to run some commands, for example setlocal spell spelllang=en_us , when I edited a file with the extension en , for example. abc.en How to implement this?

+6
source share
1 answer
  augroup spell_settings au! " set en_us as default language (unknown extension): au BufEnter * setlocal spell spelllang=en_us " set en_us for en files specifically: au BufEnter *.en setlocal spell spelllang=en_us " to add multiple commands just append: au BufEnter *.en setlocal syntax on augroup END 
+7
source

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


All Articles