vim-polyglot/ftdetect/javascript.vim

12 lines
339 B
VimL
Raw Normal View History

au BufNewFile,BufRead *.js setf javascript
au BufNewFile,BufRead *.jsm setf javascript
au BufNewFile,BufRead *.json setf javascript
au BufNewFile,BufRead Jakefile setf javascript
fun! s:SelectJavascript()
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
set ft=javascript
endif
endfun
au BufNewFile,BufRead * call s:SelectJavascript()