blob: 4fe9e8e0b0173ee82c56fb167248794d0c79227d [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" This is a GENERATED FILE. Please always refer to source file at the URI below.
3" Language: Apache configuration (httpd.conf, srm.conf, access.conf, .htaccess)
4" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
5" Last Change: 2002-10-15
6" URL: http://trific.ath.cx/Ftp/vim/syntax/apache.vim
7" Note: define apache_version to your Apache version, e.g. "1.3", "2", "2.0.39"
8
9" Setup
10if version >= 600
11 if exists("b:current_syntax")
12 finish
13 endif
14else
15 syntax clear
16endif
17
18if exists("apache_version")
19 let s:av = apache_version
20else
21 let s:av = "1.3"
22endif
23let s:av = substitute(s:av, "[^.0-9]", "", "g")
24let s:av = substitute(s:av, "^\\d\\+$", "\\0.999", "")
25let s:av = substitute(s:av, "^\\d\\+\\.\\d\\+$", "\\0.999", "")
26let s:av = substitute(s:av, "\\<\\d\\>", "0\\0", "g")
27let s:av = substitute(s:av, "\\<\\d\\d\\>", "0\\0", "g")
28let s:av = substitute(s:av, "[.]", "", "g")
29
30syn case ignore
31
32" Base constructs
33syn match apacheComment "^\s*#.*$" contains=apacheFixme
34if s:av >= "002000000"
35 syn match apacheUserID "#-\?\d\+\>"
36endif
37syn case match
38syn keyword apacheFixme FIXME TODO XXX NOT
39syn case ignore
40syn match apacheAnything "\s[^>]*" contained
41syn match apacheError "\w\+" contained
42syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+
43
44" Core and mpm
45syn keyword apacheDeclaration AccessFileName AddDefaultCharset AllowOverride AuthName AuthType ContentDigest DefaultType DocumentRoot ErrorDocument ErrorLog HostNameLookups IdentityCheck Include KeepAlive KeepAliveTimeout LimitRequestBody LimitRequestFields LimitRequestFieldsize LimitRequestLine LogLevel MaxKeepAliveRequests NameVirtualHost Options Require RLimitCPU RLimitMEM RLimitNPROC Satisfy ScriptInterpreterSource ServerAdmin ServerAlias ServerName ServerPath ServerRoot ServerSignature ServerTokens TimeOut UseCanonicalName
46if s:av < "002000000"
47 syn keyword apacheDeclaration AccessConfig AddModule BindAddress BS2000Account ClearModuleList CoreDumpDirectory Group Listen ListenBacklog LockFile MaxClients MaxRequestsPerChild MaxSpareServers MinSpareServers PidFile Port ResourceConfig ScoreBoardFile SendBufferSize ServerType StartServers ThreadsPerChild ThreadStackSize User
48endif
49if s:av >= "002000000"
50 syn keyword apacheDeclaration AcceptPathInfo CGIMapExtension EnableMMAP FileETag ForceType LimitXMLRequestBody SetHandler SetInputFilter SetOutputFilter
51 syn keyword apacheOption INode MTime Size
52endif
53syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full
54syn keyword apacheOption emerg alert crit error warn notice info debug
55syn keyword apacheOption registry script inetd standalone
56syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Includes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>"
57syn keyword apacheOption user group valid-user
58syn case match
59syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained
60syn case ignore
61syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)\+.*>" contains=apacheAnything
62syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)\+.*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError
63syn keyword apacheLimitSectionKeyword Limit LimitExcept contained
64syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue
65syn keyword apacheAuthTypeValue Basic Digest
66syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment
67syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained
68if s:av >= "002000000"
69 syn keyword apacheDeclaration CoreDumpDirectory Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MaxSpareThreadsPerChild MinSpareThreads NumServers PidFile ScoreBoardFile SendBufferSize ServerLimit StartServers StartThreads ThreadLimit ThreadsPerChild User
70 syn keyword apacheDeclaration MaxThreads ThreadStackSize
71 syn keyword apacheDeclaration AssignUserId ChildPerUserId
72 syn keyword apacheDeclaration AcceptMutex MaxSpareServers MinSpareServers
73 syn keyword apacheOption flock fcntl sysvsem pthread
74endif
75
76" Modules
77syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
78syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
79syn keyword apacheAllowDenyValue All None contained
80syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment
81syn keyword apacheOrderValue Deny Allow contained
82syn keyword apacheDeclaration Action Script
83syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch
84syn keyword apacheOption permanent temp seeother gone
85syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile
86syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail
87if s:av < "002000000"
88 syn keyword apacheDeclaration AuthDBGroupFile AuthDBUserFile AuthDBAuthoritative
89endif
90syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMUserFile AuthDBMAuthoritative
91if s:av >= "002000000"
92 syn keyword apacheDeclaration AuthDBMType
93 syn keyword apacheOption default SDBM GDBM NDBM DB
94endif
95syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestFile AuthDigestGroupFile AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestQop
96syn keyword apacheOption none auth auth-int MD5 MD5-sess
97if s:av >= "002000000"
98 syn keyword apacheDeclaration AuthLDAPAuthoritative AuthLDAPBindON AuthLDAPBindPassword AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPEnabled AuthLDAPFrontPageHack AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPStartTLS AuthLDAPUrl
99 syn keyword apacheOption always never searching finding
100endif
101if s:av < "002000000"
102 syn keyword apacheDeclaration FancyIndexing
103endif
104syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName
105syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize TrackModified
106syn keyword apacheOption Ascending Descending Name Date Size Description
107if s:av >= "002000000"
108 syn keyword apacheOption HTMLTable SupressIcon SupressRules VersionSort
109endif
110if s:av < "002000000"
111 syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase
112endif
113if s:av >= "002000000"
114 syn keyword apacheDeclaration CacheDefaultExpire CacheEnable CacheForceCompletion CacheIgnoreCacheControl CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheMaxStreamingBuffer
115endif
116syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix
117syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer
118if s:av >= "002000000"
119 syn keyword apacheDeclaration ScriptStock
120 syn keyword apacheDeclaration CharsetDefault CharsetOptions CharsetSourceEnc
121 syn keyword apacheOption DebugLevel ImplicitAdd NoImplicitAdd
122endif
123syn keyword apacheDeclaration Dav DavDepthInfinity DavLockDB DavMinTimeout
124if s:av < "002000000"
125 syn keyword apacheDeclaration Define
126end
127if s:av >= "002000000"
128 syn keyword apacheDeclaration DeflateBufferSize DeflateFilterNote DeflateMemLevel DeflateWindowSize
129endif
130if s:av < "002000000"
131 syn keyword apacheDeclaration AuthDigestFile
132endif
133syn keyword apacheDeclaration DirectoryIndex
134if s:av >= "002000000"
135 syn keyword apacheDeclaration ProtocolEcho
136endif
137syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv
138syn keyword apacheDeclaration Example
139syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault
140if s:av >= "002000000"
141 syn keyword apacheDeclaration ExtFilterDefine ExtFilterOptions
142 syn keyword apacheOption PreservesContentLength DebugLevel LogStderr NoLogStderr
143 syn keyword apacheDeclaration CacheFile MMapFile
144endif
145syn keyword apacheDeclaration Header
146if s:av >= "002000000"
147 syn keyword apacheDeclaration RequestHeader
148endif
149syn keyword apacheOption set unset append add
150syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase
151syn keyword apacheOption none formatted semiformatted unformatted
152syn keyword apacheOption nocontent referer error map
153syn keyword apacheDeclaration XBitHack
154if s:av >= "002000000"
155 syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho
156endif
157syn keyword apacheOption on off full
158syn keyword apacheDeclaration AddModuleInfo
159syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery
160if s:av >= "002000000"
161 syn keyword apacheDeclaration ISAPICacheFile ISAIPFakeAsync
162 syn keyword apacheDeclaration LDAPCacheEntries LDAPCacheTTL LDAPCertDBPath LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheSize
163endif
164if s:av < "002000000"
165 syn keyword apacheDeclaration AgentLog
166endif
167syn keyword apacheDeclaration CookieLog CustomLog LogFormat TransferLog
168if s:av < "002000000"
169 syn keyword apacheDeclaration RefererIgnore RefererLog
170endif
171if s:av >= "002000000"
172endif
173syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig
174if s:av < "002000000"
175 syn keyword apacheDeclaration ForceType SetHandler
176endif
177if s:av >= "002000000"
178 syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter
179endif
180syn keyword apacheDeclaration MimeMagicFile
181syn keyword apacheDeclaration MMapFile
182syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority
183if s:av >= "002000000"
184 syn keyword apacheDeclaration ForceLanguagePriority
185endif
186syn keyword apacheDeclaration PerlModule PerlRequire PerlTaintCheck PerlWarn
187syn keyword apacheDeclaration PerlSetVar PerlSetEnv PerlPassEnv PerlSetupEnv
188syn keyword apacheDeclaration PerlInitHandler PerlPostReadRequestHandler PerlHeaderParserHandler
189syn keyword apacheDeclaration PerlTransHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler
190syn keyword apacheDeclaration PerlTypeHandler PerlFixupHandler PerlHandler PerlLogHandler
191syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildExitHandler
192syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler
193syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader
194syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag
195syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBlock ProxyDomain ProxyPass ProxyPassReverse ProxyReceiveBufferSize ProxyRemote ProxyRequests ProxyVia
196if s:av < "002000000"
197 syn keyword apacheDeclaration CacheRoot CacheSize CacheMaxExpire CacheDefaultExpire CacheLastModifiedFactor CacheGcInterval CacheDirLevels CacheDirLength CacheForceCompletion NoCache
198 syn keyword apacheOption block
199endif
200if s:av >= "002000000"
201 syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)\+.*>" contains=apacheAnything
202 syn keyword apacheDeclaration ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPreserveHost ProxyRemoteMatch ProxyTimeout
203endif
204syn keyword apacheDeclaration RewriteEngine RewriteOptions RewriteLog RewriteLogLevel RewriteLock RewriteMap RewriteBase RewriteCond RewriteRule
205syn keyword apacheOption inherit
206if s:av < "002000000"
207 syn keyword apacheDeclaration RoamingAlias
208endif
209syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase
210syn keyword apacheDeclaration LoadFile LoadModule
211syn keyword apacheDeclaration CheckSpelling
212syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLEngine SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLRandomSeed SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLVerifyClient SSLVerifyDepth
213if s:av < "002000000"
214 syn keyword apacheDeclaration SSLLog SSLLogLevel
215endif
216if s:av >= "002000000"
217 syn keyword apacheDeclaration SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth
218endif
219syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>"
220syn keyword apacheOption builtin sem
221syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):"
222if s:av < "002000000"
223 syn match apacheOption "[+-]\?\<\(SSLv2\|SSLv3\|TLSv1\)\>"
224endif
225if s:av >= "002000000"
226 syn match apacheOption "[+-]\?\<\(SSLv2\|SSLv3\|TLSv1\|kRSA\|kHDr\|kDHd\|kEDH\|aNULL\|aRSA\|aDSS\|aRH\|eNULL\|DES\|3DES\|RC2\|RC4\|IDEA\|MD5\|SHA1\|SHA\|EXP\|EXPORT40\|EXPORT56\|LOW\|MEDIUM\|HIGH\|RSA\|DH\|EDH\|ADH\|DSS\|NULL\)\>"
227endif
228syn keyword apacheOption optional require optional_no_ca
229syn keyword apacheDeclaration ExtendedStatus
230if s:av >= "002000000"
231 syn keyword apacheDeclaration SuexecUserGroup
232endif
233syn keyword apacheDeclaration UserDir
234syn keyword apacheDeclaration CookieExpires CookieName CookieTracking
235if s:av >= "002000000"
236 syn keyword apacheDeclaration CookieDomain CookieStyle
237 syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965
238endif
239syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
240
241" Define the default highlighting
242if version >= 508 || !exists("did_apache_syntax_inits")
243 if version < 508
244 let did_apache_syntax_inits = 1
245 command -nargs=+ HiLink hi link <args>
246 else
247 command -nargs=+ HiLink hi def link <args>
248 endif
249
250 HiLink apacheAllowOverride apacheDeclaration
251 HiLink apacheAllowOverrideValue apacheOption
252 HiLink apacheAuthType apacheDeclaration
253 HiLink apacheAuthTypeValue apacheOption
254 HiLink apacheOptionOption apacheOption
255 HiLink apacheDeclaration Function
256 HiLink apacheAnything apacheOption
257 HiLink apacheOption Number
258 HiLink apacheComment Comment
259 HiLink apacheFixme Todo
260 HiLink apacheLimitSectionKeyword apacheLimitSection
261 HiLink apacheLimitSection apacheSection
262 HiLink apacheSection Label
263 HiLink apacheMethodOption Type
264 HiLink apacheAllowDeny Include
265 HiLink apacheAllowDenyValue Identifier
266 HiLink apacheOrder Special
267 HiLink apacheOrderValue String
268 HiLink apacheString String
269 HiLink apacheError Error
270 HiLink apacheUserID Number
271
272 delcommand HiLink
273endif
274
275let b:current_syntax = "apache"