2 " Language: Apache configuration (httpd.conf, srm.conf, access.conf, .htaccess)
3 " Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
4 " Last Change: 2001-05-13
5 " URI: http://physics.muni.cz/~yeti/download/apache.vim
7 " Notes: Last synced with apache-1.3.14.
8 " TODO: see particular FIXME's scattered through the file
9 " make it really linewise?
10 " + add `display' where appropriate
13 " React to possibly already-defined syntax.
14 " For version 5.x: Clear all syntax items unconditionally
15 " For version 6.x: Quit when a syntax file was already loaded
17 if exists("b:current_syntax")
24 " Set iskeyword since we need really strange chars in keywords.
25 " For version 5.x: Set it globally
26 " For version 6.x: Set it locally
28 setlocal iskeyword=@,48-57,-,+,_
30 set iskeyword=@,48-57,-,+,_
36 syn match apacheComment "^\s*#.*$" contains=apacheFixme
38 syn keyword apacheFixme FIXME TODO XXX NOT
40 syn match apacheAnything "\s[^>]*" contained
41 syn match apacheError "\w\+" contained
42 syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+
45 syn keyword apacheDeclaration AccessConfig AccessFileName AddDefaultCharset AddModule AuthName AuthType BindAddress BS2000Account ClearModuleList ContentDigest CoreDumpDirectory DefaultType DocumentRoot ErrorDocument ErrorLog Group HostNameLookups IdentityCheck Include KeepAlive KeepAliveTimeout LimitRequestBody LimitRequestFields LimitRequestFieldsize LimitRequestLine Listen ListenBacklog LockFile LogLevel MaxClients MaxKeepAliveRequests MaxRequestsPerChild MaxSpareServers MinSpareServers NameVirtualHost Options PidFile Port require ResourceConfig RLimitCPU RLimitMEM RLimitNPROC Satisfy ScoreBoardFile ScriptInterpreterSource SendBufferSize ServerAdmin ServerAlias ServerName ServerPath ServerRoot ServerSignature ServerTokens ServerType StartServers ThreadsPerChild ThreadStackSize TimeOut UseCanonicalName User
46 syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full
47 syn keyword apacheOption emerg alert crit error warn notice info debug
48 syn keyword apacheOption registry script inetd standalone
49 syn keyword apacheOptionOption ExecCGI FollowSymLinks Includes IncludesNoExec Indexes MultiViews SymLinksIfOwnerMatch
50 syn keyword apacheOptionOption +ExecCGI +FollowSymLinks +Includes +IncludesNoExec +Indexes +MultiViews +SymLinksIfOwnerMatch
51 syn keyword apacheOptionOption -ExecCGI -FollowSymLinks -Includes -IncludesNoExec -Indexes -MultiViews -SymLinksIfOwnerMatch
52 syn keyword apacheOption user group valid-user
54 syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained
56 syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)\+.*>" contains=apacheAnything
57 syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)\+.*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError
58 syn keyword apacheLimitSectionKeyword Limit LimitExcept contained
59 syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue
60 syn keyword apacheAuthTypeValue Basic Digest
61 syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment
62 syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained
66 syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
67 syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
68 syn keyword apacheAllowDenyValue All None contained
69 syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment
70 syn keyword apacheOrderValue Deny Allow contained
72 syn keyword apacheDeclaration Action Script
74 syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch
75 syn keyword apacheOption permanent temp seeother gone
76 " mod_asis (no own directives)
78 syn keyword apacheDeclaration AuthGroupFile AuthUserFile AuthAuthoritative
80 syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail
82 syn keyword apacheDeclaration AuthDBGroupFile AuthDBUserFile AuthDBAuthoritative
84 syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMUserFile AuthDBMAuthoritative
86 syn keyword apacheDeclaration AuthDigestFile AuthDigestGroupFile AuthDigestQop AuthDigestNonceLifetime AuthDigestNonceFormat AuthDigestNcCheck AuthDigestAlgorithm AuthDigestDomain
87 syn keyword apacheOption none auth auth-int MD5 MD5-sess
89 syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon FancyIndexing HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName
90 syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize
91 syn keyword apacheOption Ascending Descending Name Date Size Description
93 syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase
95 syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix
97 syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer
99 " FXIME: not implemented---don't know anything about this module
101 " FXIME: we don't highlight user defined variables at all
102 syn keyword apacheDeclaration Define
104 syn keyword apacheDeclaration AuthDigestFile
106 syn keyword apacheDeclaration DirectoryIndex
108 syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv
110 syn keyword apacheDeclaration Example
112 syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault
114 syn keyword apacheDeclaration Header
115 syn keyword apacheOption set unset append add
117 syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase
118 syn keyword apacheOption none formatted semiformatted unformatted
119 syn keyword apacheOption nocontent
121 syn keyword apacheDeclaration XBitHack
122 syn keyword apacheOption on off full
124 syn keyword apacheDeclaration AddModuleInfo
126 syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery
128 syn keyword apacheDeclaration AgentLog
130 syn keyword apacheDeclaration CookieLog CustomLog LogFormat TransferLog
132 syn keyword apacheDeclaration RefererIgnore RefererLog
134 syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage ForceType RemoveEncoding RemoveHandler RemoveType SetHandler TypesConfig
136 syn keyword apacheDeclaration MimeMagicFile
138 syn keyword apacheDeclaration MMapFile
140 syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority
142 " FXIME: not implemented---for proper highligting the whole Perl thing has to
143 " be embeded making vim incredibily s...l...o...w...
145 syn keyword apacheDeclaration ProxyRequests ProxyRemote ProxyPass ProxyPassReverse ProxyBlock AllowCONNECT ProxyReceiveBufferSize NoProxy ProxyDomain ProxyVia CacheRoot CacheSize CacheMaxExpire CacheDefaultExpire CacheLastModifiedFactor CacheGcInterval CacheDirLevels CacheDirLength CacheForceCompletion NoCache
146 syn keyword apacheOption block
148 " FXIME: not implemented---need some doc
150 " FIXME: rewriting rules are not highlighted because I don't understand them...
151 syn keyword apacheDeclaration RewriteEngine RewriteOptions RewriteLog RewriteLogLevel RewriteLock RewriteMap RewriteBase RewriteCond RewriteRule
152 syn keyword apacheOption inherit
154 syn keyword apacheDeclaration RoamingAlias
156 syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase
158 syn keyword apacheDeclaration LoadFile LoadModule
160 syn keyword apacheDeclaration CheckSpelling
162 " FIXME: SSLCipherSuite parameters are not properly highlighted
163 " FIXME: SSLRequire rules are not highlighted
164 syn keyword apacheDeclaration SSLPassPhraseDialog SSLMutex SSLRandomSeed SSLSessionCache SSLSessionCacheTimeout SSLEngine SSLProtocol SSLCipherSuite SSLCertificateFile SSLCertificateKeyFile SSLCertificateChainFile SSLCACertificatePath SSLCACertificateFile SSLCARevocationPath SSLCARevocationFile SSLVerifyClient SSLVerifyDepth SSLLog SSLLogLevel SSLOptions SSLRequireSSL SSLRequire
165 syn keyword apacheOption StdEnvVars CompatEnvVars ExportCertData FakeBasicAuth StrictRequire OptRenegotiate
166 syn keyword apacheOption +StdEnvVars +CompatEnvVars +ExportCertData +FakeBasicAuth +StrictRequire +OptRenegotiate
167 syn keyword apacheOption -StdEnvVars -CompatEnvVars -ExportCertData -FakeBasicAuth -StrictRequire -OptRenegotiate
168 syn keyword apacheOption builtin sem
169 syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):"
170 syn keyword apacheOption SSLv2 SSLv3 TLSv1 -SSLv2 -SSLv3 -TLSv1 +SSLv2 +SSLv3 +TLSv1
171 syn keyword apacheOption optional require optional_no_ca
173 syn keyword apacheDeclaration ExtendedStatus
175 syn keyword apacheDeclaration UserDir
177 syn keyword apacheDeclaration CookieExpires CookieName CookieTracking
179 syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
181 " Define the default highlighting {{{
182 " For version 5.7 and earlier: Only when not done already
183 " For version 5.8 and later: Only when an item doesn't have highlighting yet
184 if version >= 508 || !exists("did_apache_syntax_inits")
186 let did_apache_syntax_inits = 1
187 command -nargs=+ HiLink hi link <args>
189 command -nargs=+ HiLink hi def link <args>
192 HiLink apacheAllowOverride apacheDeclaration
193 HiLink apacheAllowOverrideValue apacheOption
194 HiLink apacheAuthType apacheDeclaration
195 HiLink apacheAuthTypeValue apacheOption
196 HiLink apacheOptionOption apacheOption
197 HiLink apacheDeclaration Function
198 HiLink apacheAnything apacheOption
199 HiLink apacheOption Number
200 HiLink apacheComment Comment
201 HiLink apacheFixme Todo
202 HiLink apacheLimitSectionKeyword apacheLimitSection
203 HiLink apacheLimitSection apacheSection
204 HiLink apacheSection Label
205 HiLink apacheMethodOption Type
206 HiLink apacheAllowDeny Include
207 HiLink apacheAllowDenyValue Identifier
208 HiLink apacheOrder Special
209 HiLink apacheOrderValue String
210 HiLink apacheString Number
211 HiLink apacheError Error
216 let b:current_syntax = "apache"