aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.vim/ftdetect/node.vim
blob: ed50604b634d454f8f9edbbd036e8370b51c7824 (plain)
1
2
3
4
5
6
7
8
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