vimrc/sources_non_forked/vim-javascript/ftdetect/javascript.vim

9 lines
257 B
VimL
Raw Normal View History

fun! s:SelectJavascript()
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
set ft=javascript
endif
endfun
2020-06-21 15:50:44 +00:00
autocmd BufNewFile,BufRead *.{js,mjs,cjs,jsm,es,es6},Jakefile setfiletype javascript
autocmd BufNewFile,BufRead * call s:SelectJavascript()