1
0
Fork 0
mirror of synced 2024-11-16 05:55:35 -05:00
ultimate-vim/sources_non_forked/vim-node/ftdetect/node.vim
2014-06-13 21:52:19 +08:00

8 lines
259 B
VimL

function! s:isNode()
let shebang = getline(1)
if shebang =~# '^#!.*/bin/env\s\+node\>' | return 1 | en
if shebang =~# '^#!.*/bin/node\>' | return 1 | en
return 0
endfunction
au BufRead,BufNewFile * if !did_filetype() && s:isNode() | setf javascript | en