7
|
1 " Vim syntax file
|
|
2 " Language: lite
|
|
3 " Maintainer: Lutz Eymers <ixtab@polzin.com>
|
|
4 " URL: http://www.isp.de/data/lite.vim
|
|
5 " Email: Subject: send syntax_vim.tgz
|
|
6 " Last Change: 2001 Mai 01
|
|
7 "
|
|
8 " Options lite_sql_query = 1 for SQL syntax highligthing inside strings
|
|
9 " lite_minlines = x to sync at least x lines backwards
|
|
10
|
|
11 " For version 5.x: Clear all syntax items
|
|
12 " For version 6.x: Quit when a syntax file was already loaded
|
|
13 if version < 600
|
|
14 syntax clear
|
|
15 elseif exists("b:current_syntax")
|
|
16 finish
|
|
17 endif
|
|
18
|
|
19 if !exists("main_syntax")
|
|
20 let main_syntax = 'lite'
|
|
21 endif
|
|
22
|
|
23 if main_syntax == 'lite'
|
|
24 if exists("lite_sql_query")
|
|
25 if lite_sql_query == 1
|
|
26 syn include @liteSql <sfile>:p:h/sql.vim
|
|
27 unlet b:current_syntax
|
|
28 endif
|
|
29 endif
|
|
30 endif
|
|
31
|
|
32 if main_syntax == 'msql'
|
|
33 if exists("msql_sql_query")
|
|
34 if msql_sql_query == 1
|
|
35 syn include @liteSql <sfile>:p:h/sql.vim
|
|
36 unlet b:current_syntax
|
|
37 endif
|
|
38 endif
|
|
39 endif
|
|
40
|
|
41 syn cluster liteSql remove=sqlString,sqlComment
|
|
42
|
|
43 syn case match
|
|
44
|
|
45 " Internal Variables
|
|
46 syn keyword liteIntVar ERRMSG contained
|
|
47
|
|
48 " Comment
|
|
49 syn region liteComment start="/\*" end="\*/" contains=liteTodo
|
|
50
|
|
51 " Function names
|
|
52 syn keyword liteFunctions echo printf fprintf open close read
|
|
53 syn keyword liteFunctions readln readtok
|
|
54 syn keyword liteFunctions split strseg chop tr sub substr
|
|
55 syn keyword liteFunctions test unlink umask chmod mkdir chdir rmdir
|
|
56 syn keyword liteFunctions rename truncate link symlink stat
|
|
57 syn keyword liteFunctions sleep system getpid getppid kill
|
|
58 syn keyword liteFunctions time ctime time2unixtime unixtime2year
|
|
59 syn keyword liteFunctions unixtime2year unixtime2month unixtime2day
|
|
60 syn keyword liteFunctions unixtime2hour unixtime2min unixtime2sec
|
|
61 syn keyword liteFunctions strftime
|
|
62 syn keyword liteFunctions getpwnam getpwuid
|
|
63 syn keyword liteFunctions gethostbyname gethostbyaddress
|
|
64 syn keyword liteFunctions urlEncode setContentType includeFile
|
|
65 syn keyword liteFunctions msqlConnect msqlClose msqlSelectDB
|
|
66 syn keyword liteFunctions msqlQuery msqlStoreResult msqlFreeResult
|
|
67 syn keyword liteFunctions msqlFetchRow msqlDataSeek msqlListDBs
|
|
68 syn keyword liteFunctions msqlListTables msqlInitFieldList msqlListField
|
|
69 syn keyword liteFunctions msqlFieldSeek msqlNumRows msqlEncode
|
|
70 syn keyword liteFunctions exit fatal typeof
|
|
71 syn keyword liteFunctions crypt addHttpHeader
|
|
72
|
|
73 " Conditional
|
|
74 syn keyword liteConditional if else
|
|
75
|
|
76 " Repeat
|
|
77 syn keyword liteRepeat while
|
|
78
|
|
79 " Operator
|
|
80 syn keyword liteStatement break return continue
|
|
81
|
|
82 " Operator
|
|
83 syn match liteOperator "[-+=#*]"
|
|
84 syn match liteOperator "/[^*]"me=e-1
|
|
85 syn match liteOperator "\$"
|
|
86 syn match liteRelation "&&"
|
|
87 syn match liteRelation "||"
|
|
88 syn match liteRelation "[!=<>]="
|
|
89 syn match liteRelation "[<>]"
|
|
90
|
|
91 " Identifier
|
|
92 syn match liteIdentifier "$\h\w*" contains=liteIntVar,liteOperator
|
|
93 syn match liteGlobalIdentifier "@\h\w*" contains=liteIntVar
|
|
94
|
|
95 " Include
|
|
96 syn keyword liteInclude load
|
|
97
|
|
98 " Define
|
|
99 syn keyword liteDefine funct
|
|
100
|
|
101 " Type
|
|
102 syn keyword liteType int uint char real
|
|
103
|
|
104 " String
|
|
105 syn region liteString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=liteIdentifier,liteSpecialChar,@liteSql
|
|
106
|
|
107 " Number
|
|
108 syn match liteNumber "-\=\<\d\+\>"
|
|
109
|
|
110 " Float
|
|
111 syn match liteFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
|
|
112
|
|
113 " SpecialChar
|
|
114 syn match liteSpecialChar "\\[abcfnrtv\\]" contained
|
|
115
|
|
116 syn match liteParentError "[)}\]]"
|
|
117
|
|
118 " Todo
|
|
119 syn keyword liteTodo TODO Todo todo contained
|
|
120
|
|
121 " dont syn #!...
|
|
122 syn match liteExec "^#!.*$"
|
|
123
|
|
124 " Parents
|
|
125 syn cluster liteInside contains=liteComment,liteFunctions,liteIdentifier,liteGlobalIdentifier,liteConditional,liteRepeat,liteStatement,liteOperator,liteRelation,liteType,liteString,liteNumber,liteFloat,liteParent
|
|
126
|
|
127 syn region liteParent matchgroup=Delimiter start="(" end=")" contains=@liteInside
|
|
128 syn region liteParent matchgroup=Delimiter start="{" end="}" contains=@liteInside
|
|
129 syn region liteParent matchgroup=Delimiter start="\[" end="\]" contains=@liteInside
|
|
130
|
|
131 " sync
|
|
132 if main_syntax == 'lite'
|
|
133 if exists("lite_minlines")
|
|
134 exec "syn sync minlines=" . lite_minlines
|
|
135 else
|
|
136 syn sync minlines=100
|
|
137 endif
|
|
138 endif
|
|
139
|
|
140 " Define the default highlighting.
|
|
141 " For version 5.7 and earlier: only when not done already
|
|
142 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
143 if version >= 508 || !exists("did_lite_syn_inits")
|
|
144 if version < 508
|
|
145 let did_lite_syn_inits = 1
|
|
146 command -nargs=+ HiLink hi link <args>
|
|
147 else
|
|
148 command -nargs=+ HiLink hi def link <args>
|
|
149 endif
|
|
150
|
|
151 HiLink liteComment Comment
|
|
152 HiLink liteString String
|
|
153 HiLink liteNumber Number
|
|
154 HiLink liteFloat Float
|
|
155 HiLink liteIdentifier Identifier
|
|
156 HiLink liteGlobalIdentifier Identifier
|
|
157 HiLink liteIntVar Identifier
|
|
158 HiLink liteFunctions Function
|
|
159 HiLink liteRepeat Repeat
|
|
160 HiLink liteConditional Conditional
|
|
161 HiLink liteStatement Statement
|
|
162 HiLink liteType Type
|
|
163 HiLink liteInclude Include
|
|
164 HiLink liteDefine Define
|
|
165 HiLink liteSpecialChar SpecialChar
|
|
166 HiLink liteParentError liteError
|
|
167 HiLink liteError Error
|
|
168 HiLink liteTodo Todo
|
|
169 HiLink liteOperator Operator
|
|
170 HiLink liteRelation Operator
|
|
171
|
|
172 delcommand HiLink
|
|
173 endif
|
|
174
|
|
175 let b:current_syntax = "lite"
|
|
176
|
|
177 if main_syntax == 'lite'
|
|
178 unlet main_syntax
|
|
179 endif
|
|
180
|
|
181 " vim: ts=8
|