1
0
Fork 0
mirror of synced 2024-11-16 14:05:34 -05:00
ultimate-vim/sources_non_forked/vim-node/ftdetect/node.vim

9 lines
259 B
VimL
Raw Normal View History

2014-06-13 09:52:19 -04:00
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