use :setfiletype for setting filetype when no filetype is set yet

15d9890eee/runtime/doc/options.txt (L376-L385)
This commit is contained in:
rhysd 2021-11-07 22:45:34 +09:00
parent 46f7df4dec
commit 23615cca0f

View file

@ -1,7 +1 @@
autocmd BufRead,BufNewFile *.wgsl call s:set_wgsl_filetype()
function! s:set_wgsl_filetype() abort
if &filetype !=# 'wgsl'
set filetype=wgsl
endif
endfunction
autocmd BufRead,BufNewFile *.wgsl setfiletype wgsl