diff --git a/README.textile b/README.textile index 1a7ce55..c8e1324 100644 --- a/README.textile +++ b/README.textile @@ -18,7 +18,8 @@ h2. What it does This plugin is pretty basic right now. It currently: -* Sets *Spec.js and *SpecHelper.js files to filetype=jasmine+javascript +* Sets *Spec.js and *SpecHelper.js files to filetype=jasmine.javascript syntax=jasmine +* Sets *Spec.coffee and *SpecHelper.coffee files to filetype=jasmine.coffee syntax=jasmine * Applies basic syntax highlighting for jasmine keywords in addition to normal javascript syntax * Loads snippets for the jasmine filetype for: ** desc: description block with before..it..expect diff --git a/ftdetect/jasmine.vim b/ftdetect/jasmine.vim index f201b60..5fd1d16 100644 --- a/ftdetect/jasmine.vim +++ b/ftdetect/jasmine.vim @@ -1 +1,2 @@ autocmd BufNewFile,BufRead,BufWritePost *Spec.js,*SpecHelper.js set filetype=jasmine.javascript syntax=jasmine +autocmd BufNewFile,BufRead,BufWritePost *Spec.coffee,*SpecHelper.coffee set filetype=jasmine.coffee syntax=jasmine diff --git a/syntax/jasmine.vim b/syntax/jasmine.vim index 112164c..1199746 100644 --- a/syntax/jasmine.vim +++ b/syntax/jasmine.vim @@ -2,7 +2,11 @@ if exists("b:current_syntax") finish endif -runtime! syntax/javascript.vim +if &ft =~ "coffee" + runtime! syntax/coffee.vim +else + runtime! syntax/javascript.vim +endif syn case match syn keyword specFunctions afterEach beforeEach describe it expect addMatchers spyOn not