vim-polyglot/ftdetect/javascript.vim
Adam Stankiewicz 01fe1500df Add support for basic languages
coffee, cucumbeer, eruby, haml, haskell, javascript,
json, less, nginx, ocaml, ruby, sass, scss, slim,
stylus, textile, tmux
2013-09-12 16:17:03 +02:00

12 lines
339 B
VimL

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()