Permalink
Browse files

detect coffee from shebang line

  • Loading branch information...
Vincent Côté-Roy authored and kchmck committed Feb 4, 2012
1 parent 319700c commit cdd52c83900eeda29a2789e144ec86bad2cd9b89
Showing with 10 additions and 0 deletions.
  1. +10 −0 ftdetect/coffee.vim
View
@@ -6,3 +6,13 @@
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
autocmd BufNewFile,BufRead *.coffeekup set filetype=coffee
+
+fun! s:DetectCoffee()
+ if getline(1) =~ '^#!.*\<coffee\>'
+ set filetype=coffee
+ endif
+endfun
+autocmd BufNewFile,BufRead * call s:DetectCoffee()
+
+
+

0 comments on commit cdd52c8

Please sign in to comment.