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