Files
vim-javascript-syntax/ftdetect/javascript.vim
Mike Williamson 405df92c21 Set filetype based on node shebang
Recognizes the node shebang line and sets the filetype to javascript.
Syntax highlights the shebang as well.
2012-05-24 20:35:40 -04:00

7 lines
171 B
VimL

function! s:DetectJS()
if getline(1) =~# '^#!.*/bin/env\s\+node\>'
setfiletype javascript
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectJS()