Skip to content

Commit a7437e0

Browse files
author
othree_kao
committed
Different postprocess for different filetype
1 parent 7f7bbdf commit a7437e0

6 files changed

Lines changed: 67 additions & 47 deletions

File tree

autoload/jslibsyntax.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function! jslibsyntax#load()
4444
let index = index + 1
4545
endwhile
4646
if loaded > 0
47-
exe('source '.s:path.'/syntax/postprocess.vim')
47+
exe('source '.s:path.'/syntax/postprocess.'.&filetype.'.vim')
4848
endif
4949
endfunction
5050

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
" Vim syntax file
2+
" Language: JS Lib syntax post process for coffee
3+
" Maintainer: othree <othree@gmail.com>
4+
" Last Change: 2013/02/25
5+
" Version: 0.4
6+
" URL: https://github.com/othree/javascript-libraries-syntax.vim
7+
"
8+
9+
syntax cluster coffeeLibraryFuncs contains=@coffeeQFunctions,@coffee_Functions,@coffeeBFunctions,@coffeepFunctions
10+
syntax cluster coffeeLibraryAttrs contains=@coffeeQAttrs,@coffee_Attrs,@coffeeBAttrs,@coffeepAttrs
11+
syntax match coffeeLMethods /[0-9A-Za-z_$)]\.\h\w*(\@=/ containedin=ALLBUT,coffeeComment contains=@coffeeLibraryFuncs transparent
12+
syntax match coffeeLMethods /[0-9A-Za-z_$)]\.\h\w* \+[0-9A-Za-z_$([{'"]\@=/ containedin=ALLBUT,coffeeComment contains=@coffeeLibraryFuncs transparent
13+
syntax match coffeeLMethods /[0-9A-Za-z_$)]\.\h\w* \([-=]>\)\@=/ containedin=ALLBUT,coffeeComment contains=@coffeeLibraryFuncs transparent
14+
syntax match coffeeLAttrs /[0-9A-Za-z_$)]\.\h\w*/ containedin=ALLBUT,coffeeComment contains=@coffeeLibraryAttrs transparent
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
" Vim syntax file
2+
" Language: JS Lib syntax post process for javascript
3+
" Maintainer: othree <othree@gmail.com>
4+
" Last Change: 2013/02/25
5+
" Version: 0.4
6+
" URL: https://github.com/othree/javascript-libraries-syntax.vim
7+
"
8+
9+
syntax cluster javascriptLibraryFuncs contains=@javascriptQFunctions,@javascript_Functions,@javascriptBFunctions,@javascriptpFunctions,@javascriptAFunctions
10+
syntax cluster javascriptLibraryAttrs contains=@javascriptQAttrs,@javascript_Attrs,@javascriptBAttrs,@javascriptpAttrs,@javascriptAAttrs
11+
syntax match javascriptLMethods /[0-9A-Za-z_$)]\.\h\w*(\@=/ containedin=ALLBUT,javascriptComment contains=@javascriptLibraryFuncs transparent
12+
syntax match javascriptLAttrs /[0-9A-Za-z_$)]\.\h\w*/ containedin=ALLBUT,javascriptComment contains=@javascriptLibraryAttrs transparent

autoload/syntax/postprocess.ls.vim

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
" Vim syntax file
2+
" Language: JS Lib syntax post process for ls
3+
" Maintainer: othree <othree@gmail.com>
4+
" Last Change: 2013/02/25
5+
" Version: 0.4
6+
" URL: https://github.com/othree/javascript-libraries-syntax.vim
7+
"
8+
9+
syntax cluster lsLibraryFuncs contains=@lsQFunctions,@ls_Functions,@lsBFunctions,@lspFunctions
10+
syntax cluster lsLibraryAttrs contains=@lsQAttrs,@ls_Attrs,@lsBAttrs,@lspAttrs
11+
" ).fun!
12+
" ).fun()
13+
" fun0!fun!
14+
" fun0!fun()
15+
" obj.fun!
16+
" obj.fun()
17+
syntax match lsLMethods /\([0-9A-Za-z_$][.!]\|)\.\)\h\w*[(!]\@=/ containedin=ALLBUT,lsComment contains=@lsLibraryFuncs transparent
18+
" ).fun arg
19+
" !fun arg
20+
" obj.fun arg
21+
syntax match lsLMethods /\([0-9A-Za-z_$][.!]\|)\.\)\h\w* \+[0-9A-Za-z_$([{\'"]\@=/ containedin=ALLBUT,lsComment contains=@lsLibraryFuncs transparent
22+
" ).fun funarg
23+
" !fun funarg
24+
" obj.fun funarg
25+
syntax match lsLMethods /\([0-9A-Za-z_$][.!]\|)\.\)\h\w* \(!\?[~-]>\)\@=/ containedin=ALLBUT,lsComment contains=@lsLibraryFuncs transparent
26+
syntax match lsLPipe /|>/ containedin=ALLBUT,lsComment skipwhite nextgroup=@lspFunctions
27+
syntax match lsLCompose />>/ containedin=ALLBUT,lsComment skipwhite nextgroup=@lspFunctions
28+
syntax match lsLAttrs /\([0-9A-Za-z_$][.!]\|)\.\)\h\w*/ containedin=ALL contains=@lsLibraryAttrs transparent
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
" Vim syntax file
2+
" Language: JS Lib syntax post process for typescript
3+
" Maintainer: othree <othree@gmail.com>
4+
" Last Change: 2013/02/25
5+
" Version: 0.4
6+
" URL: https://github.com/othree/javascript-libraries-syntax.vim
7+
"
8+
9+
syntax cluster javascriptLibraryFuncs contains=@javascriptQFunctions,@javascript_Functions,@javascriptBFunctions,@javascriptpFunctions,@javascriptAFunctions
10+
syntax cluster javascriptLibraryAttrs contains=@javascriptQAttrs,@javascript_Attrs,@javascriptBAttrs,@javascriptpAttrs,@javascriptAAttrs
11+
syntax match javascriptLMethods /[0-9A-Za-z_$)]\.\h\w*(\@=/ containedin=ALLBUT,javascriptComment contains=@javascriptLibraryFuncs transparent
12+
syntax match javascriptLAttrs /[0-9A-Za-z_$)]\.\h\w*/ containedin=ALLBUT,javascriptComment contains=@javascriptLibraryAttrs transparent

autoload/syntax/postprocess.vim

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)