Add jasmine support
This commit is contained in:
parent
610f4c5701
commit
daa6fc6958
1
build
1
build
@ -83,6 +83,7 @@ PACKS="
|
||||
haskell:travitch/hasksyn
|
||||
html5:othree/html5.vim
|
||||
jade:digitaltoad/vim-jade
|
||||
jasmine:glanotte/vim-jasmine
|
||||
javascript:pangloss/vim-javascript
|
||||
json:leshill/vim-json
|
||||
jst:briancollins/vim-jst
|
||||
|
@ -48,6 +48,7 @@ autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
||||
autocmd BufNewFile,BufRead *.sass setf sass
|
||||
autocmd BufNewFile,BufRead *.scss setf scss
|
||||
autocmd BufNewFile,BufReadPost *.jade set filetype=jade
|
||||
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
||||
au BufNewFile,BufRead *.js setf javascript
|
||||
au BufNewFile,BufRead *.jsm setf javascript
|
||||
au BufNewFile,BufRead Jakefile setf javascript
|
||||
|
34
syntax/jasmine.vim
Normal file
34
syntax/jasmine.vim
Normal file
@ -0,0 +1,34 @@
|
||||
" Syntax highlighting for jasmine specs (used by http://github.com/thomd/vim-jasmine).
|
||||
|
||||
" if b:current_syntax is defined, some other syntax files, earlier in 'runtimepath' was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" match the case of syntax elements
|
||||
syntax case match
|
||||
|
||||
" keywords
|
||||
syntax keyword jasmineSuite describe it beforeEach afterEach
|
||||
syntax keyword jasmineDisabled xdescribe xit
|
||||
syntax keyword jasmineExpectation expect
|
||||
syntax region jasmineNot start=/not/ end=/\.to/me=s-1
|
||||
syntax match jasmineMatcher /\.to\h\+/
|
||||
syntax keyword jasmineSpy spyOn
|
||||
syntax match jasmineSpyMatcher /and\h\+/
|
||||
|
||||
" jasmine is a subset of the javascript language, thus we need to activate
|
||||
" javascript syntax highlighting and add new jasmin group names to the
|
||||
" JavaScriptAll cluster which is defined there
|
||||
runtime! syntax/javascript.vim
|
||||
syntax cluster JavaScriptAll add=jasmineSuite,jasmineDisabled,jasmineExpectation,jasmineNot,jasmineMatcher,jasmineSpy,jasmineSpyMatcher
|
||||
|
||||
let b:current_syntax = "jasmine"
|
||||
|
||||
hi def link jasmineSuite Statement
|
||||
hi def link jasmineDisabled Error
|
||||
hi def link jasmineExpectation Statement
|
||||
hi def link jasmineNot Special
|
||||
hi def link jasmineMatcher Statement
|
||||
hi def link jasmineSpy Special
|
||||
hi def link jasmineSpyMatcher Statement
|
5
test_spec.js
Normal file
5
test_spec.js
Normal file
@ -0,0 +1,5 @@
|
||||
describe("A suite", function() {
|
||||
it("contains spec with an expectation", function() {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user