blob: dd18aa65700ddf684acb3e8ced3152418e8e3424 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar071d4272004-06-13 20:20:40 +00002" Language: Apache configuration (httpd.conf, srm.conf, access.conf, .htaccess)
Bram Moolenaarbaca7f72013-09-22 14:42:24 +02003" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00004" License: This file can be redistribued and/or modified under the same terms
5" as Vim itself.
Bram Moolenaar4f4d51a2020-10-11 13:57:40 +02006" Last Change: 2020 Oct 07
Bram Moolenaar756ec0f2007-05-05 17:59:48 +00007" Notes: Last synced with apache-2.2.3, version 1.x is no longer supported
Bram Moolenaar7fc904b2006-04-13 20:37:35 +00008" TODO: see particular FIXME's scattered through the file
9" make it really linewise?
10" + add `display' where appropriate
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020012" quit when a syntax file was already loaded
13if exists("b:current_syntax")
14 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000015endif
16
Bram Moolenaar071d4272004-06-13 20:20:40 +000017syn case ignore
18
19" Base constructs
20syn match apacheComment "^\s*#.*$" contains=apacheFixme
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000021syn match apacheUserID "#-\?\d\+\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000022syn case match
23syn keyword apacheFixme FIXME TODO XXX NOT
24syn case ignore
25syn match apacheAnything "\s[^>]*" contained
26syn match apacheError "\w\+" contained
Bram Moolenaarbaca7f72013-09-22 14:42:24 +020027syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ oneline
28
29" Following is to prevent escaped quotes from being parsed as strings.
30syn match apacheSkipQuote +\\"+
Bram Moolenaar071d4272004-06-13 20:20:40 +000031
32" Core and mpm
33syn 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
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000034syn keyword apacheDeclaration AcceptPathInfo CGIMapExtension EnableMMAP FileETag ForceType LimitXMLRequestBody SetHandler SetInputFilter SetOutputFilter
35syn keyword apacheDeclaration AcceptFilter AllowEncodedSlashes EnableSendfile LimitInternalRecursion TraceEnable
36syn keyword apacheOption INode MTime Size
Bram Moolenaar071d4272004-06-13 20:20:40 +000037syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full
38syn keyword apacheOption emerg alert crit error warn notice info debug
39syn keyword apacheOption registry script inetd standalone
40syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Includes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000041syn keyword apacheOption user group
42syn match apacheOption "\<valid-user\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000043syn case match
44syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained
Bram Moolenaar4f4d51a2020-10-11 13:57:40 +020045" Added as suggested by Mikko Koivunalho
46syn keyword apacheMethodOption BASELINE-CONTROL CHECKIN CHECKOUT LABEL MERGE MKACTIVITY MKWORKSPACE REPORT UNCHECKOUT UPDATE VERSION-CONTROL contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000047syn case ignore
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000048syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything
49syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError
Bram Moolenaar071d4272004-06-13 20:20:40 +000050syn keyword apacheLimitSectionKeyword Limit LimitExcept contained
51syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue
52syn keyword apacheAuthTypeValue Basic Digest
53syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment
54syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000055syn keyword apacheDeclaration CoreDumpDirectory EnableExceptionHook GracefulShutdownTimeout Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MaxSpareThreadsPerChild MinSpareThreads NumServers PidFile ScoreBoardFile SendBufferSize ServerLimit StartServers StartThreads ThreadLimit ThreadsPerChild User
56syn keyword apacheDeclaration MaxThreads ThreadStackSize
57syn keyword apacheDeclaration Win32DisableAcceptEx
58syn keyword apacheDeclaration AssignUserId ChildPerUserId
59syn keyword apacheDeclaration AcceptMutex MaxSpareServers MinSpareServers
60syn keyword apacheOption flock fcntl sysvsem pthread
Bram Moolenaar071d4272004-06-13 20:20:40 +000061
62" Modules
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000063syn keyword apacheDeclaration Action Script
64syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch
65syn keyword apacheOption permanent temp seeother gone
66syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile
67syn keyword apacheDeclaration AuthBasicAuthoritative AuthBasicProvider
68syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestProvider AuthDigestQop AuthDigestShmemSize
69syn keyword apacheOption none auth auth-int MD5 MD5-sess
70syn match apacheSection "<\/\=\(<AuthnProviderAlias\)[^>]*>" contains=apacheAnything
71syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail
72syn keyword apacheDeclaration AuthDBDUserPWQuery AuthDBDUserRealmQuery
73syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMAuthoritative
74syn keyword apacheDeclaration AuthDBM TypeAuthDBMUserFile
75syn keyword apacheOption default SDBM GDBM NDBM DB
76syn keyword apacheDeclaration AuthDefaultAuthoritative
77syn keyword apacheDeclaration AuthUserFile
78syn keyword apacheDeclaration AuthLDAPBindON AuthLDAPEnabled AuthLDAPFrontPageHack AuthLDAPStartTLS
79syn keyword apacheDeclaration AuthLDAPBindDN AuthLDAPBindPassword AuthLDAPCharsetConfig AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPUrl AuthzLDAPAuthoritative
80syn keyword apacheOption always never searching finding
81syn keyword apacheOption ldap-user ldap-group ldap-dn ldap-attribute ldap-filter
82syn keyword apacheDeclaration AuthDBMGroupFile AuthzDBMAuthoritative AuthzDBMType
83syn keyword apacheDeclaration AuthzDefaultAuthoritative
84syn keyword apacheDeclaration AuthGroupFile AuthzGroupFileAuthoritative
Bram Moolenaar071d4272004-06-13 20:20:40 +000085syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
86syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
87syn keyword apacheAllowDenyValue All None contained
88syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment
89syn keyword apacheOrderValue Deny Allow contained
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000090syn keyword apacheDeclaration AuthzOwnerAuthoritative
91syn keyword apacheDeclaration AuthzUserAuthoritative
Bram Moolenaar071d4272004-06-13 20:20:40 +000092syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000093syn keyword apacheDeclaration IndexStyleSheet
Bram Moolenaar071d4272004-06-13 20:20:40 +000094syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize TrackModified
95syn keyword apacheOption Ascending Descending Name Date Size Description
Bram Moolenaar756ec0f2007-05-05 17:59:48 +000096syn keyword apacheOption HTMLTable SuppressIcon SuppressRules VersionSort XHTML
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000097syn keyword apacheOption IgnoreClient IgnoreCase ShowForbidden SuppresRules
98syn keyword apacheDeclaration CacheForceCompletion CacheMaxStreamingBuffer
99syn keyword apacheDeclaration CacheDefaultExpire CacheDisable CacheEnable CacheIgnoreCacheControl CacheIgnoreHeaders CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheStoreNoStore CacheStorePrivate
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix
101syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000102syn keyword apacheDeclaration ScriptStock
103syn keyword apacheDeclaration CharsetDefault CharsetOptions CharsetSourceEnc
104syn keyword apacheOption DebugLevel ImplicitAdd NoImplicitAdd
105syn keyword apacheDeclaration Dav DavDepthInfinity DavMinTimeout
106syn keyword apacheDeclaration DavLockDB
107syn keyword apacheDeclaration DavGenericLockDB
108syn keyword apacheDeclaration DBDExptime DBDKeep DBDMax DBDMin DBDParams DBDPersist DBDPrepareSQL DBDriver
109syn keyword apacheDeclaration DeflateCompressionLevel DeflateBufferSize DeflateFilterNote DeflateMemLevel DeflateWindowSize
110syn keyword apacheDeclaration DirectoryIndex DirectorySlash
111syn keyword apacheDeclaration CacheExpiryCheck CacheGcClean CacheGcDaily CacheGcInterval CacheGcMemUsage CacheGcUnused CacheSize CacheTimeMargin
112syn keyword apacheDeclaration CacheDirLength CacheDirLevels CacheMaxFileSize CacheMinFileSize CacheRoot
113syn keyword apacheDeclaration DumpIOInput DumpIOOutput
114syn keyword apacheDeclaration ProtocolEcho
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv
116syn keyword apacheDeclaration Example
117syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000118syn keyword apacheDeclaration ExtFilterDefine ExtFilterOptions
119syn keyword apacheOption PreservesContentLength DebugLevel LogStderr NoLogStderr
120syn match apacheOption "\<\(cmd\|mode\|intype\|outtype\|ftype\|disableenv\|enableenv\)\ze="
121syn keyword apacheDeclaration CacheFile MMapFile
122syn keyword apacheDeclaration FilterChain FilterDeclare FilterProtocol FilterProvider FilterTrace
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123syn keyword apacheDeclaration Header
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000124syn keyword apacheDeclaration RequestHeader
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125syn keyword apacheOption set unset append add
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000126syn keyword apacheDeclaration IdentityCheck IdentityCheckTimeout
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase
128syn keyword apacheOption none formatted semiformatted unformatted
129syn keyword apacheOption nocontent referer error map
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000130syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho XBitHack
Bram Moolenaar071d4272004-06-13 20:20:40 +0000131syn keyword apacheOption on off full
132syn keyword apacheDeclaration AddModuleInfo
133syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000134syn keyword apacheDeclaration ISAPICacheFile ISAIPFakeAsync
135syn keyword apacheDeclaration LDAPCertDBPath
136syn keyword apacheDeclaration LDAPCacheEntries LDAPCacheTTL LDAPConnectionTimeout LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheFile LDAPSharedCacheSize LDAPTrustedClientCert LDAPTrustedGlobalCert LDAPTrustedMode LDAPVerifyServerCert
137syn keyword apacheOption CA_DER CA_BASE64 CA_CERT7_DB CA_SECMOD CERT_DER CERT_BASE64 CERT_KEY3_DB CERT_NICKNAME CERT_PFX KEY_DER KEY_BASE64 KEY_PFX
138syn keyword apacheDeclaration BufferedLogs CookieLog CustomLog LogFormat TransferLog
139syn keyword apacheDeclaration ForensicLog
140syn keyword apacheDeclaration MCacheMaxObjectCount MCacheMaxObjectSize MCacheMaxStreamingBuffer MCacheMinObjectSize MCacheRemovalAlgorithm MCacheSize
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000142syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter RemoveCharset
143syn keyword apacheOption NegotiatedOnly Filters Handlers
Bram Moolenaar071d4272004-06-13 20:20:40 +0000144syn keyword apacheDeclaration MimeMagicFile
145syn keyword apacheDeclaration MMapFile
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000146syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority ForceLanguagePriority
147syn keyword apacheDeclaration NWSSLTrustedCerts NWSSLUpgradeable SecureListen
Bram Moolenaar071d4272004-06-13 20:20:40 +0000148syn keyword apacheDeclaration PerlModule PerlRequire PerlTaintCheck PerlWarn
149syn keyword apacheDeclaration PerlSetVar PerlSetEnv PerlPassEnv PerlSetupEnv
150syn keyword apacheDeclaration PerlInitHandler PerlPostReadRequestHandler PerlHeaderParserHandler
151syn keyword apacheDeclaration PerlTransHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler
152syn keyword apacheDeclaration PerlTypeHandler PerlFixupHandler PerlHandler PerlLogHandler
153syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildExitHandler
154syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler
155syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader
156syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000157syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)[^>]*>" contains=apacheAnything
Bram Moolenaar08589172014-03-08 18:38:28 +0100158syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPass ProxyPassMatch ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiePath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxyTimeout ProxyVia
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000159syn keyword apacheDeclaration RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule
Bram Moolenaar071d4272004-06-13 20:20:40 +0000160syn keyword apacheOption inherit
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase
162syn keyword apacheDeclaration LoadFile LoadModule
Bram Moolenaar756ec0f2007-05-05 17:59:48 +0000163syn keyword apacheDeclaration CheckSpelling CheckCaseOnly
Bram Moolenaard47d5222018-12-09 20:43:55 +0100164syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCADNRequestFile SSLCADNRequestPath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLCompression SSLCryptoDevice SSLEngine SSLFIPS SSLHonorCipherOrder SSLInsecureRenegotiation SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCheckPeerCN SSLProxyCheckPeerExpire SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateChainFile SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth SSLRandomSeed SSLRenegBufferSize SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLSessionTicketKeyFile SSLSessionTickets SSLStrictSNIVHostCheck SSLUserName SSLVerifyClient SSLVerifyDepth
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>"
166syn keyword apacheOption builtin sem
167syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000168syn 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\)\>"
169syn keyword apacheOption optional optional_no_ca
Bram Moolenaar071d4272004-06-13 20:20:40 +0000170syn keyword apacheDeclaration ExtendedStatus
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000171syn keyword apacheDeclaration SuexecUserGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172syn keyword apacheDeclaration UserDir
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000173syn keyword apacheDeclaration CookieDomain CookieExpires CookieName CookieStyle CookieTracking
174syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965
175syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything
Bram Moolenaar071d4272004-06-13 20:20:40 +0000176syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
177
178" Define the default highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000179
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200180hi def link apacheAllowOverride apacheDeclaration
181hi def link apacheAllowOverrideValue apacheOption
182hi def link apacheAuthType apacheDeclaration
183hi def link apacheAuthTypeValue apacheOption
184hi def link apacheOptionOption apacheOption
185hi def link apacheDeclaration Function
186hi def link apacheAnything apacheOption
187hi def link apacheOption Number
188hi def link apacheComment Comment
189hi def link apacheFixme Todo
190hi def link apacheLimitSectionKeyword apacheLimitSection
191hi def link apacheLimitSection apacheSection
192hi def link apacheSection Label
193hi def link apacheMethodOption Type
194hi def link apacheAllowDeny Include
195hi def link apacheAllowDenyValue Identifier
196hi def link apacheOrder Special
197hi def link apacheOrderValue String
198hi def link apacheString String
199hi def link apacheError Error
200hi def link apacheUserID Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000201
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202
203let b:current_syntax = "apache"