Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/gsp.vim @ 0:76efa0be13f1
Initial revision
author | atsuki |
---|---|
date | Sat, 10 Nov 2007 15:07:22 +0900 |
parents | |
children | 67300faee616 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:76efa0be13f1 |
---|---|
1 " Vim syntax file | |
2 " Language: GSP - GNU Server Pages (v. 0.86) | |
3 " Created By: Nathaniel Harward nharward@yahoo.com | |
4 " Last Changed: Dec. 12, 2000 | |
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 | |
37 " Add <java> as an HTML tag name along with its args | |
38 syn keyword htmlTagName contained java | |
39 syn keyword htmlArg contained type file page | |
40 | |
41 " Redefine some HTML things to include (and highlight) gspInLine code in | |
42 " places where it's likely to be found | |
43 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine | |
44 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine | |
45 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc,gspInLine | |
46 syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError,gspInLine | |
47 syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,gspInLine | |
48 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine | |
49 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine | |
50 | |
51 " Define the GSP java code blocks | |
52 syn region gspJavaBlock start="<java\>[^>]*\>" end="</java>"me=e-7 contains=@gspJava,htmlTag | |
53 syn region gspInLine matchgroup=htmlError start="`" end="`" contains=@gspJava | |
54 | |
55 let b:current_syntax = "gsp" | |
56 | |
57 if main_syntax == 'gsp' | |
58 unlet main_syntax | |
59 endif |