7
|
1 " Vim syntax file
|
|
2 " Language: GSP - GNU Server Pages (v. 0.86)
|
|
3 " Created By: Nathaniel Harward nharward@yahoo.com
|
3256
|
4 " Last Changed: 2012 Jan 08 by Thilo Six
|
7
|
5 " Filenames: *.gsp
|
|
6 " URL: http://www.constructicon.com/~nharward/vim/syntax/gsp.vim
|
|
7
|
|
8 " For version 5.x: Clear all syntax items
|
|
9 " For version 6.x: Quit when a syntax file was already loaded
|
|
10 if version < 600
|
|
11 syntax clear
|
|
12 elseif exists("b:current_syntax")
|
|
13 finish
|
|
14 endif
|
|
15
|
|
16 if !exists("main_syntax")
|
|
17 let main_syntax = 'gsp'
|
|
18 endif
|
|
19
|
|
20 " Source HTML syntax
|
|
21 if version < 600
|
|
22 source <sfile>:p:h/html.vim
|
|
23 else
|
|
24 runtime! syntax/html.vim
|
|
25 endif
|
|
26 unlet b:current_syntax
|
|
27
|
|
28 syn case match
|
|
29
|
|
30 " Include Java syntax
|
|
31 if version < 600
|
|
32 syn include @gspJava <sfile>:p:h/java.vim
|
|
33 else
|
|
34 syn include @gspJava syntax/java.vim
|
|
35 endif
|
|
36
|
3256
|
37 let s:cpo_save = &cpo
|
|
38 set cpo&vim
|
|
39
|
7
|
40 " Add <java> as an HTML tag name along with its args
|
|
41 syn keyword htmlTagName contained java
|
|
42 syn keyword htmlArg contained type file page
|
|
43
|
|
44 " Redefine some HTML things to include (and highlight) gspInLine code in
|
|
45 " places where it's likely to be found
|
|
46 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine
|
|
47 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine
|
|
48 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc,gspInLine
|
|
49 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError,gspInLine
|
|
50 syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,gspInLine
|
|
51 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine
|
|
52 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine
|
|
53
|
|
54 " Define the GSP java code blocks
|
|
55 syn region gspJavaBlock start="<java\>[^>]*\>" end="</java>"me=e-7 contains=@gspJava,htmlTag
|
|
56 syn region gspInLine matchgroup=htmlError start="`" end="`" contains=@gspJava
|
|
57
|
|
58 let b:current_syntax = "gsp"
|
|
59
|
|
60 if main_syntax == 'gsp'
|
|
61 unlet main_syntax
|
|
62 endif
|
3256
|
63
|
|
64 let &cpo = s:cpo_save
|
|
65 unlet s:cpo_save
|