Permalink
Browse files

node.js ftdetect from @mmalecki

  • Loading branch information...
1 parent cfd23c2 commit f9347eaa442110514cab066d78c479b64b010065 @isaacs committed Nov 6, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 ftdetect/node.js.vim
View
@@ -0,0 +1,18 @@
+" vim-node.js - file type detect plugin for vim which detects node.js shebang
+" Author: Maciej Malecki
+" Version: 1.1.0
+" License: MIT
+"
+" Install via pathogen by cloning/adding submodule in ~/.vim/bundle or
+" by dropping this script in ~/vim/ftdetect
+
+function DetectNode()
+ if !did_filetype()
+ if getline(1) =~ '^#.*\<node\>'
+ setfiletype javascript
+ endif
+ endif
+endfunction
+
+:au BufNewFile,BufRead * call DetectNode()
+

0 comments on commit f9347ea

Please sign in to comment.