summaryrefslogtreecommitdiffstats
path: root/ftdetect/coffee.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ftdetect/coffee.vim')
-rw-r--r--ftdetect/coffee.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/ftdetect/coffee.vim b/ftdetect/coffee.vim
new file mode 100644
index 00000000..50569298
--- /dev/null
+++ b/ftdetect/coffee.vim
@@ -0,0 +1,17 @@
+" Language: CoffeeScript
+" Maintainer: Mick Koch <kchmck@gmail.com>
+" URL: http://github.com/kchmck/vim-coffee-script
+" License: WTFPL
+
+autocmd BufNewFile,BufRead *.coffee set filetype=coffee
+autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
+autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
+autocmd BufNewFile,BufRead *._coffee set filetype=coffee
+
+function! s:DetectCoffee()
+ if getline(1) =~ '^#!.*\<coffee\>'
+ set filetype=coffee
+ endif
+endfunction
+
+autocmd BufNewFile,BufRead * call s:DetectCoffee()