diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-06-08 12:44:15 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-06-08 12:44:15 +0200 |
commit | 671078ef6c851b688b63165761cec82f9f6e03f7 (patch) | |
tree | efde30baaf2ca21a09a35e1ccf1d2ff744482d2b /ftdetect | |
parent | aebef2c2e76b88384b1121c237c965e8cf8b3bcb (diff) | |
download | vim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.tar.gz vim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.zip |
Update
Diffstat (limited to 'ftdetect')
-rw-r--r-- | ftdetect/polyglot.vim | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index d8ab62c4..d6a7fea1 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1202,9 +1202,15 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 " rust, from rust.vim in rust-lang/rust.vim " vint: -ProhibitAutocmdWithNoGroup -autocmd BufRead,BufNewFile *.rs setf rust +autocmd BufRead,BufNewFile *.rs call s:set_rust_filetype() autocmd BufRead,BufNewFile Cargo.toml setf FALLBACK cfg +function! s:set_rust_filetype() abort + if &filetype !=# 'rust' + set filetype=rust + endif +endfunction + " vim: set et sw=4 sts=4 ts=8: augroup end endif @@ -1294,10 +1300,10 @@ endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1 augroup filetypedetect " terraform, from terraform.vim in hashivim/vim-terraform -au BufRead,BufNewFile *.tf setlocal filetype=terraform -au BufRead,BufNewFile *.tfvars setlocal filetype=terraform -au BufRead,BufNewFile *.tfstate setlocal filetype=json -au BufRead,BufNewFile *.tfstate.backup setlocal filetype=json +autocmd BufRead,BufNewFile *.tf set filetype=terraform +autocmd BufRead,BufNewFile *.tfvars set filetype=terraform +autocmd BufRead,BufNewFile *.tfstate set filetype=json +autocmd BufRead,BufNewFile *.tfstate.backup set filetype=json augroup end endif |