blob: d2b8be733b1f6dc7ce44de15f42a0c94d186e944 [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.
nisbet-hubbard4dd6c222024-11-23 13:14:47 +01006" Last Change: 2024 Nov 23
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
nisbet-hubbard4dd6c222024-11-23 13:14:47 +010017syn iskeyword @,48-57,_,192-255,-
Bram Moolenaar071d4272004-06-13 20:20:40 +000018syn case ignore
19
20" Base constructs
21syn match apacheComment "^\s*#.*$" contains=apacheFixme
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000022syn match apacheUserID "#-\?\d\+\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000023syn case match
24syn keyword apacheFixme FIXME TODO XXX NOT
25syn case ignore
26syn match apacheAnything "\s[^>]*" contained
27syn match apacheError "\w\+" contained
Bram Moolenaarbaca7f72013-09-22 14:42:24 +020028syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ oneline
29
30" Following is to prevent escaped quotes from being parsed as strings.
31syn match apacheSkipQuote +\\"+
Bram Moolenaar071d4272004-06-13 20:20:40 +000032
33" Core and mpm
34syn 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 +000035syn keyword apacheDeclaration AcceptPathInfo CGIMapExtension EnableMMAP FileETag ForceType LimitXMLRequestBody SetHandler SetInputFilter SetOutputFilter
36syn keyword apacheDeclaration AcceptFilter AllowEncodedSlashes EnableSendfile LimitInternalRecursion TraceEnable
37syn keyword apacheOption INode MTime Size
Bram Moolenaar071d4272004-06-13 20:20:40 +000038syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full
39syn keyword apacheOption emerg alert crit error warn notice info debug
40syn keyword apacheOption registry script inetd standalone
41syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Includes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000042syn keyword apacheOption user group
43syn match apacheOption "\<valid-user\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +000044syn case match
45syn 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 +020046" Added as suggested by Mikko Koivunalho
47syn keyword apacheMethodOption BASELINE-CONTROL CHECKIN CHECKOUT LABEL MERGE MKACTIVITY MKWORKSPACE REPORT UNCHECKOUT UPDATE VERSION-CONTROL contained
Bram Moolenaar071d4272004-06-13 20:20:40 +000048syn case ignore
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000049syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything
Bram Moolenaarce001a32022-04-27 15:25:03 +010050syn match apacheSection "<\/\=\(RequireAll\|RequireAny\|RequireNone\)>" contains=apacheAnything
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000051syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError
Bram Moolenaar071d4272004-06-13 20:20:40 +000052syn keyword apacheLimitSectionKeyword Limit LimitExcept contained
53syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue
54syn keyword apacheAuthTypeValue Basic Digest
55syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment
56syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000057syn 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
58syn keyword apacheDeclaration MaxThreads ThreadStackSize
59syn keyword apacheDeclaration Win32DisableAcceptEx
60syn keyword apacheDeclaration AssignUserId ChildPerUserId
61syn keyword apacheDeclaration AcceptMutex MaxSpareServers MinSpareServers
62syn keyword apacheOption flock fcntl sysvsem pthread
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
64" Modules
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000065syn keyword apacheDeclaration Action Script
66syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch
67syn keyword apacheOption permanent temp seeother gone
68syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile
69syn keyword apacheDeclaration AuthBasicAuthoritative AuthBasicProvider
70syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestProvider AuthDigestQop AuthDigestShmemSize
71syn keyword apacheOption none auth auth-int MD5 MD5-sess
72syn match apacheSection "<\/\=\(<AuthnProviderAlias\)[^>]*>" contains=apacheAnything
73syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail
74syn keyword apacheDeclaration AuthDBDUserPWQuery AuthDBDUserRealmQuery
75syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMAuthoritative
76syn keyword apacheDeclaration AuthDBM TypeAuthDBMUserFile
77syn keyword apacheOption default SDBM GDBM NDBM DB
78syn keyword apacheDeclaration AuthDefaultAuthoritative
79syn keyword apacheDeclaration AuthUserFile
80syn keyword apacheDeclaration AuthLDAPBindON AuthLDAPEnabled AuthLDAPFrontPageHack AuthLDAPStartTLS
81syn keyword apacheDeclaration AuthLDAPBindDN AuthLDAPBindPassword AuthLDAPCharsetConfig AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPUrl AuthzLDAPAuthoritative
82syn keyword apacheOption always never searching finding
83syn keyword apacheOption ldap-user ldap-group ldap-dn ldap-attribute ldap-filter
84syn keyword apacheDeclaration AuthDBMGroupFile AuthzDBMAuthoritative AuthzDBMType
85syn keyword apacheDeclaration AuthzDefaultAuthoritative
86syn keyword apacheDeclaration AuthGroupFile AuthzGroupFileAuthoritative
Bram Moolenaar071d4272004-06-13 20:20:40 +000087syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
88syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
89syn keyword apacheAllowDenyValue All None contained
90syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment
91syn keyword apacheOrderValue Deny Allow contained
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000092syn keyword apacheDeclaration AuthzOwnerAuthoritative
93syn keyword apacheDeclaration AuthzUserAuthoritative
Bram Moolenaar071d4272004-06-13 20:20:40 +000094syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000095syn keyword apacheDeclaration IndexStyleSheet
Bram Moolenaar071d4272004-06-13 20:20:40 +000096syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize TrackModified
97syn keyword apacheOption Ascending Descending Name Date Size Description
Bram Moolenaar756ec0f2007-05-05 17:59:48 +000098syn keyword apacheOption HTMLTable SuppressIcon SuppressRules VersionSort XHTML
Bram Moolenaar7fc904b2006-04-13 20:37:35 +000099syn keyword apacheOption IgnoreClient IgnoreCase ShowForbidden SuppresRules
100syn keyword apacheDeclaration CacheForceCompletion CacheMaxStreamingBuffer
101syn keyword apacheDeclaration CacheDefaultExpire CacheDisable CacheEnable CacheIgnoreCacheControl CacheIgnoreHeaders CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheStoreNoStore CacheStorePrivate
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix
103syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000104syn keyword apacheDeclaration ScriptStock
105syn keyword apacheDeclaration CharsetDefault CharsetOptions CharsetSourceEnc
106syn keyword apacheOption DebugLevel ImplicitAdd NoImplicitAdd
107syn keyword apacheDeclaration Dav DavDepthInfinity DavMinTimeout
108syn keyword apacheDeclaration DavLockDB
109syn keyword apacheDeclaration DavGenericLockDB
110syn keyword apacheDeclaration DBDExptime DBDKeep DBDMax DBDMin DBDParams DBDPersist DBDPrepareSQL DBDriver
111syn keyword apacheDeclaration DeflateCompressionLevel DeflateBufferSize DeflateFilterNote DeflateMemLevel DeflateWindowSize
112syn keyword apacheDeclaration DirectoryIndex DirectorySlash
113syn keyword apacheDeclaration CacheExpiryCheck CacheGcClean CacheGcDaily CacheGcInterval CacheGcMemUsage CacheGcUnused CacheSize CacheTimeMargin
114syn keyword apacheDeclaration CacheDirLength CacheDirLevels CacheMaxFileSize CacheMinFileSize CacheRoot
115syn keyword apacheDeclaration DumpIOInput DumpIOOutput
116syn keyword apacheDeclaration ProtocolEcho
Bram Moolenaar071d4272004-06-13 20:20:40 +0000117syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv
118syn keyword apacheDeclaration Example
119syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000120syn keyword apacheDeclaration ExtFilterDefine ExtFilterOptions
121syn keyword apacheOption PreservesContentLength DebugLevel LogStderr NoLogStderr
122syn match apacheOption "\<\(cmd\|mode\|intype\|outtype\|ftype\|disableenv\|enableenv\)\ze="
123syn keyword apacheDeclaration CacheFile MMapFile
124syn keyword apacheDeclaration FilterChain FilterDeclare FilterProtocol FilterProvider FilterTrace
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125syn keyword apacheDeclaration Header
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000126syn keyword apacheDeclaration RequestHeader
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127syn keyword apacheOption set unset append add
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000128syn keyword apacheDeclaration IdentityCheck IdentityCheckTimeout
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase
130syn keyword apacheOption none formatted semiformatted unformatted
131syn keyword apacheOption nocontent referer error map
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000132syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho XBitHack
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133syn keyword apacheOption on off full
134syn keyword apacheDeclaration AddModuleInfo
135syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000136syn keyword apacheDeclaration ISAPICacheFile ISAIPFakeAsync
137syn keyword apacheDeclaration LDAPCertDBPath
138syn keyword apacheDeclaration LDAPCacheEntries LDAPCacheTTL LDAPConnectionTimeout LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheFile LDAPSharedCacheSize LDAPTrustedClientCert LDAPTrustedGlobalCert LDAPTrustedMode LDAPVerifyServerCert
139syn 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
140syn keyword apacheDeclaration BufferedLogs CookieLog CustomLog LogFormat TransferLog
141syn keyword apacheDeclaration ForensicLog
142syn keyword apacheDeclaration MCacheMaxObjectCount MCacheMaxObjectSize MCacheMaxStreamingBuffer MCacheMinObjectSize MCacheRemovalAlgorithm MCacheSize
Bram Moolenaar071d4272004-06-13 20:20:40 +0000143syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000144syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter RemoveCharset
145syn keyword apacheOption NegotiatedOnly Filters Handlers
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146syn keyword apacheDeclaration MimeMagicFile
147syn keyword apacheDeclaration MMapFile
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000148syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority ForceLanguagePriority
149syn keyword apacheDeclaration NWSSLTrustedCerts NWSSLUpgradeable SecureListen
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150syn keyword apacheDeclaration PerlModule PerlRequire PerlTaintCheck PerlWarn
151syn keyword apacheDeclaration PerlSetVar PerlSetEnv PerlPassEnv PerlSetupEnv
152syn keyword apacheDeclaration PerlInitHandler PerlPostReadRequestHandler PerlHeaderParserHandler
153syn keyword apacheDeclaration PerlTransHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler
154syn keyword apacheDeclaration PerlTypeHandler PerlFixupHandler PerlHandler PerlLogHandler
155syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildExitHandler
156syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler
157syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader
158syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000159syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)[^>]*>" contains=apacheAnything
Bram Moolenaar08589172014-03-08 18:38:28 +0100160syn 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 +0000161syn keyword apacheDeclaration RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162syn keyword apacheOption inherit
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase
164syn keyword apacheDeclaration LoadFile LoadModule
Bram Moolenaar756ec0f2007-05-05 17:59:48 +0000165syn keyword apacheDeclaration CheckSpelling CheckCaseOnly
Bram Moolenaard47d5222018-12-09 20:43:55 +0100166syn 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 +0000167syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>"
168syn keyword apacheOption builtin sem
169syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):"
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000170syn 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\)\>"
171syn keyword apacheOption optional optional_no_ca
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172syn keyword apacheDeclaration ExtendedStatus
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000173syn keyword apacheDeclaration SuexecUserGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000174syn keyword apacheDeclaration UserDir
Bram Moolenaar7fc904b2006-04-13 20:37:35 +0000175syn keyword apacheDeclaration CookieDomain CookieExpires CookieName CookieStyle CookieTracking
176syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965
177syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
179
180" Define the default highlighting
Bram Moolenaar071d4272004-06-13 20:20:40 +0000181
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200182hi def link apacheAllowOverride apacheDeclaration
183hi def link apacheAllowOverrideValue apacheOption
184hi def link apacheAuthType apacheDeclaration
185hi def link apacheAuthTypeValue apacheOption
186hi def link apacheOptionOption apacheOption
187hi def link apacheDeclaration Function
188hi def link apacheAnything apacheOption
189hi def link apacheOption Number
190hi def link apacheComment Comment
191hi def link apacheFixme Todo
192hi def link apacheLimitSectionKeyword apacheLimitSection
193hi def link apacheLimitSection apacheSection
194hi def link apacheSection Label
195hi def link apacheMethodOption Type
196hi def link apacheAllowDeny Include
197hi def link apacheAllowDenyValue Identifier
198hi def link apacheOrder Special
199hi def link apacheOrderValue String
200hi def link apacheString String
201hi def link apacheError Error
202hi def link apacheUserID Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000203
Bram Moolenaar071d4272004-06-13 20:20:40 +0000204
205let b:current_syntax = "apache"