My Vim Configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

8 lines
259 B

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