1" Vim syntax file 2" Language: Apache configuration (httpd.conf, srm.conf, access.conf, .htaccess) 3" Maintainer: David Necas (Yeti) <[email protected]> 4" License: This file can be redistribued and/or modified under the same terms 5" as Vim itself. 6" Last Change: 2014-03-04 7" Notes: Last synced with apache-2.2.3, version 1.x is no longer supported 8" TODO: see particular FIXME's scattered through the file 9" make it really linewise? 10" + add `display' where appropriate 11 12" Setup 13if version >= 600 14 if exists("b:current_syntax") 15 finish 16 endif 17else 18 syntax clear 19endif 20 21syn case ignore 22 23" Base constructs 24syn match apacheComment "^\s*#.*$" contains=apacheFixme 25syn match apacheUserID "#-\?\d\+\>" 26syn case match 27syn keyword apacheFixme FIXME TODO XXX NOT 28syn case ignore 29syn match apacheAnything "\s[^>]*" contained 30syn match apacheError "\w\+" contained 31syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ oneline 32 33" Following is to prevent escaped quotes from being parsed as strings. 34syn match apacheSkipQuote +\\"+ 35 36" Core and mpm 37syn 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 38syn keyword apacheDeclaration AcceptPathInfo CGIMapExtension EnableMMAP FileETag ForceType LimitXMLRequestBody SetHandler SetInputFilter SetOutputFilter 39syn keyword apacheDeclaration AcceptFilter AllowEncodedSlashes EnableSendfile LimitInternalRecursion TraceEnable 40syn keyword apacheOption INode MTime Size 41syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full 42syn keyword apacheOption emerg alert crit error warn notice info debug 43syn keyword apacheOption registry script inetd standalone 44syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Includes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>" 45syn keyword apacheOption user group 46syn match apacheOption "\<valid-user\>" 47syn case match 48syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained 49syn case ignore 50syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything 51syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError 52syn 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 57syn 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 63 64" Modules 65syn 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 87syn 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 92syn keyword apacheDeclaration AuthzOwnerAuthoritative 93syn keyword apacheDeclaration AuthzUserAuthoritative 94syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName 95syn keyword apacheDeclaration IndexStyleSheet 96syn 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 98syn keyword apacheOption HTMLTable SuppressIcon SuppressRules VersionSort XHTML 99syn keyword apacheOption IgnoreClient IgnoreCase ShowForbidden SuppresRules 100syn keyword apacheDeclaration CacheForceCompletion CacheMaxStreamingBuffer 101syn keyword apacheDeclaration CacheDefaultExpire CacheDisable CacheEnable CacheIgnoreCacheControl CacheIgnoreHeaders CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheStoreNoStore CacheStorePrivate 102syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix 103syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer 104syn 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 117syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv 118syn keyword apacheDeclaration Example 119syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault 120syn 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 125syn keyword apacheDeclaration Header 126syn keyword apacheDeclaration RequestHeader 127syn keyword apacheOption set unset append add 128syn keyword apacheDeclaration IdentityCheck IdentityCheckTimeout 129syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase 130syn keyword apacheOption none formatted semiformatted unformatted 131syn keyword apacheOption nocontent referer error map 132syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho XBitHack 133syn keyword apacheOption on off full 134syn keyword apacheDeclaration AddModuleInfo 135syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery 136syn 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 143syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig 144syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter RemoveCharset 145syn keyword apacheOption NegotiatedOnly Filters Handlers 146syn keyword apacheDeclaration MimeMagicFile 147syn keyword apacheDeclaration MMapFile 148syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority ForceLanguagePriority 149syn keyword apacheDeclaration NWSSLTrustedCerts NWSSLUpgradeable SecureListen 150syn 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 159syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)[^>]*>" contains=apacheAnything 160syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPass ProxyPassMatch ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiePath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxyTimeout ProxyVia 161syn keyword apacheDeclaration RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule 162syn keyword apacheOption inherit 163syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase 164syn keyword apacheDeclaration LoadFile LoadModule 165syn keyword apacheDeclaration CheckSpelling CheckCaseOnly 166syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCADNRequestFile SSLCADNRequestPath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLCryptoDevice SSLEngine SSLHonorCipherOrder SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth SSLRandomSeed SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLUserName SSLVerifyClient SSLVerifyDepth 167syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>" 168syn keyword apacheOption builtin sem 169syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):" 170syn 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 172syn keyword apacheDeclaration ExtendedStatus 173syn keyword apacheDeclaration SuexecUserGroup 174syn keyword apacheDeclaration UserDir 175syn keyword apacheDeclaration CookieDomain CookieExpires CookieName CookieStyle CookieTracking 176syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965 177syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything 178syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP 179 180" Define the default highlighting 181if version >= 508 || !exists("did_apache_syntax_inits") 182 if version < 508 183 let did_apache_syntax_inits = 1 184 command -nargs=+ HiLink hi link <args> 185 else 186 command -nargs=+ HiLink hi def link <args> 187 endif 188 189 HiLink apacheAllowOverride apacheDeclaration 190 HiLink apacheAllowOverrideValue apacheOption 191 HiLink apacheAuthType apacheDeclaration 192 HiLink apacheAuthTypeValue apacheOption 193 HiLink apacheOptionOption apacheOption 194 HiLink apacheDeclaration Function 195 HiLink apacheAnything apacheOption 196 HiLink apacheOption Number 197 HiLink apacheComment Comment 198 HiLink apacheFixme Todo 199 HiLink apacheLimitSectionKeyword apacheLimitSection 200 HiLink apacheLimitSection apacheSection 201 HiLink apacheSection Label 202 HiLink apacheMethodOption Type 203 HiLink apacheAllowDeny Include 204 HiLink apacheAllowDenyValue Identifier 205 HiLink apacheOrder Special 206 HiLink apacheOrderValue String 207 HiLink apacheString String 208 HiLink apacheError Error 209 HiLink apacheUserID Number 210 211 delcommand HiLink 212endif 213 214let b:current_syntax = "apache" 215