diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2015-07-18 22:54:07 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2015-07-18 22:54:07 +0200 |
commit | 9ab9275f66562de7d87df31ac8f2786981d770fd (patch) | |
tree | 81d0b5d52af0c98954f6fe340965f92fbe3916bf /after/syntax | |
parent | 1c80c4bb08ae250d2eb19aabe0f31c1b2bdf5097 (diff) | |
download | vim-polyglot-9ab9275f66562de7d87df31ac8f2786981d770fd.tar.gz vim-polyglot-9ab9275f66562de7d87df31ac8f2786981d770fd.zip |
Add cjsx support
Diffstat (limited to 'after/syntax')
-rw-r--r-- | after/syntax/coffee.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/after/syntax/coffee.vim b/after/syntax/coffee.vim new file mode 100644 index 00000000..64e0dc4f --- /dev/null +++ b/after/syntax/coffee.vim @@ -0,0 +1,27 @@ +if exists('b:current_syntax') + let s:current_syntax=b:current_syntax + unlet b:current_syntax +endif + +if exists('s:current_syntax') + let b:current_syntax=s:current_syntax +endif + +syn match cjsxEntity contained "&[^; \t]*;" contains=cjsxEntityPunct +syn match cjsxEntityPunct contained "[&.;]" + +syn match cjsxAttribProperty /[A-Za-z_][A-Za-z0-9_-]*/ contained +syn region cjsxAttrib start=/\s[A-Za-z_][A-Za-z0-9_-]/hs=s+1 end=/=/ end=/\s[A-Za-z_]/me=e-2 end=+[/>]+me=e-1 contained contains=cjsxAttribProperty + +syn region cjsxBody start=+[^/]>+ms=s+2 start=/>/ms=s+1 end=+<\/+me=e-2 contained contains=cjsxElement,coffeeCurlies,cjsxEntity + +syn region cjsxElement start=/<@\=[A-Za-z_][A-Za-z0-9-_\.]*/ end=/\/>/ end=/<\/@\=[A-Za-z_][A-Za-z0-9-_\.]*>/ contains=cjsxOpenTag,cjsxBody,coffeeCurlies,coffeeString,cjsxAttrib,coffeeNumber,coffeeFloat + +syn cluster coffeeAll add=cjsxElement + +" The default highlighting. +hi def link cjsxElement Function +hi def link cjsxTagName Function +hi def link cjsxEntity Statement +hi def link cjsxEntityPunct Type +hi def link cjsxAttribProperty Type |