9 lines
259 B
VimL
9 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
|