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" quit when a syntax file was already loaded 13if exists("b:current_syntax") 14 finish 15endif 16 17syn case ignore 18 19" Base constructs 20syn match apacheComment "^\s*#.*$" contains=apacheFixme 21syn match apacheUserID "#-\?\d\+\>" 22syn case match 23syn keyword apacheFixme FIXME TODO XXX NOT 24syn case ignore 25syn match apacheAnything "\s[^>]*" contained 26syn match apacheError "\w\+" contained 27syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+ oneline 28 29" Following is to prevent escaped quotes from being parsed as strings. 30syn match apacheSkipQuote +\\"+ 31 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 34syn 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 37syn 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\)\>" 41syn keyword apacheOption user group 42syn match apacheOption "\<valid-user\>" 43syn case match 44syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained 45syn case ignore 46syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything 47syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError 48syn keyword apacheLimitSectionKeyword Limit LimitExcept contained 49syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue 50syn keyword apacheAuthTypeValue Basic Digest 51syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment 52syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained 53syn 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 54syn keyword apacheDeclaration MaxThreads ThreadStackSize 55syn keyword apacheDeclaration Win32DisableAcceptEx 56syn keyword apacheDeclaration AssignUserId ChildPerUserId 57syn keyword apacheDeclaration AcceptMutex MaxSpareServers MinSpareServers 58syn keyword apacheOption flock fcntl sysvsem pthread 59 60" Modules 61syn keyword apacheDeclaration Action Script 62syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch 63syn keyword apacheOption permanent temp seeother gone 64syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile 65syn keyword apacheDeclaration AuthBasicAuthoritative AuthBasicProvider 66syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestProvider AuthDigestQop AuthDigestShmemSize 67syn keyword apacheOption none auth auth-int MD5 MD5-sess 68syn match apacheSection "<\/\=\(<AuthnProviderAlias\)[^>]*>" contains=apacheAnything 69syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail 70syn keyword apacheDeclaration AuthDBDUserPWQuery AuthDBDUserRealmQuery 71syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMAuthoritative 72syn keyword apacheDeclaration AuthDBM TypeAuthDBMUserFile 73syn keyword apacheOption default SDBM GDBM NDBM DB 74syn keyword apacheDeclaration AuthDefaultAuthoritative 75syn keyword apacheDeclaration AuthUserFile 76syn keyword apacheDeclaration AuthLDAPBindON AuthLDAPEnabled AuthLDAPFrontPageHack AuthLDAPStartTLS 77syn keyword apacheDeclaration AuthLDAPBindDN AuthLDAPBindPassword AuthLDAPCharsetConfig AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPUrl AuthzLDAPAuthoritative 78syn keyword apacheOption always never searching finding 79syn keyword apacheOption ldap-user ldap-group ldap-dn ldap-attribute ldap-filter 80syn keyword apacheDeclaration AuthDBMGroupFile AuthzDBMAuthoritative AuthzDBMType 81syn keyword apacheDeclaration AuthzDefaultAuthoritative 82syn keyword apacheDeclaration AuthGroupFile AuthzGroupFileAuthoritative 83syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment 84syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment 85syn keyword apacheAllowDenyValue All None contained 86syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment 87syn keyword apacheOrderValue Deny Allow contained 88syn keyword apacheDeclaration AuthzOwnerAuthoritative 89syn keyword apacheDeclaration AuthzUserAuthoritative 90syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName 91syn keyword apacheDeclaration IndexStyleSheet 92syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize TrackModified 93syn keyword apacheOption Ascending Descending Name Date Size Description 94syn keyword apacheOption HTMLTable SuppressIcon SuppressRules VersionSort XHTML 95syn keyword apacheOption IgnoreClient IgnoreCase ShowForbidden SuppresRules 96syn keyword apacheDeclaration CacheForceCompletion CacheMaxStreamingBuffer 97syn keyword apacheDeclaration CacheDefaultExpire CacheDisable CacheEnable CacheIgnoreCacheControl CacheIgnoreHeaders CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheStoreNoStore CacheStorePrivate 98syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix 99syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer 100syn keyword apacheDeclaration ScriptStock 101syn keyword apacheDeclaration CharsetDefault CharsetOptions CharsetSourceEnc 102syn keyword apacheOption DebugLevel ImplicitAdd NoImplicitAdd 103syn keyword apacheDeclaration Dav DavDepthInfinity DavMinTimeout 104syn keyword apacheDeclaration DavLockDB 105syn keyword apacheDeclaration DavGenericLockDB 106syn keyword apacheDeclaration DBDExptime DBDKeep DBDMax DBDMin DBDParams DBDPersist DBDPrepareSQL DBDriver 107syn keyword apacheDeclaration DeflateCompressionLevel DeflateBufferSize DeflateFilterNote DeflateMemLevel DeflateWindowSize 108syn keyword apacheDeclaration DirectoryIndex DirectorySlash 109syn keyword apacheDeclaration CacheExpiryCheck CacheGcClean CacheGcDaily CacheGcInterval CacheGcMemUsage CacheGcUnused CacheSize CacheTimeMargin 110syn keyword apacheDeclaration CacheDirLength CacheDirLevels CacheMaxFileSize CacheMinFileSize CacheRoot 111syn keyword apacheDeclaration DumpIOInput DumpIOOutput 112syn keyword apacheDeclaration ProtocolEcho 113syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv 114syn keyword apacheDeclaration Example 115syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault 116syn keyword apacheDeclaration ExtFilterDefine ExtFilterOptions 117syn keyword apacheOption PreservesContentLength DebugLevel LogStderr NoLogStderr 118syn match apacheOption "\<\(cmd\|mode\|intype\|outtype\|ftype\|disableenv\|enableenv\)\ze=" 119syn keyword apacheDeclaration CacheFile MMapFile 120syn keyword apacheDeclaration FilterChain FilterDeclare FilterProtocol FilterProvider FilterTrace 121syn keyword apacheDeclaration Header 122syn keyword apacheDeclaration RequestHeader 123syn keyword apacheOption set unset append add 124syn keyword apacheDeclaration IdentityCheck IdentityCheckTimeout 125syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase 126syn keyword apacheOption none formatted semiformatted unformatted 127syn keyword apacheOption nocontent referer error map 128syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho XBitHack 129syn keyword apacheOption on off full 130syn keyword apacheDeclaration AddModuleInfo 131syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery 132syn keyword apacheDeclaration ISAPICacheFile ISAIPFakeAsync 133syn keyword apacheDeclaration LDAPCertDBPath 134syn keyword apacheDeclaration LDAPCacheEntries LDAPCacheTTL LDAPConnectionTimeout LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheFile LDAPSharedCacheSize LDAPTrustedClientCert LDAPTrustedGlobalCert LDAPTrustedMode LDAPVerifyServerCert 135syn 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 136syn keyword apacheDeclaration BufferedLogs CookieLog CustomLog LogFormat TransferLog 137syn keyword apacheDeclaration ForensicLog 138syn keyword apacheDeclaration MCacheMaxObjectCount MCacheMaxObjectSize MCacheMaxStreamingBuffer MCacheMinObjectSize MCacheRemovalAlgorithm MCacheSize 139syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig 140syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter RemoveCharset 141syn keyword apacheOption NegotiatedOnly Filters Handlers 142syn keyword apacheDeclaration MimeMagicFile 143syn keyword apacheDeclaration MMapFile 144syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority ForceLanguagePriority 145syn keyword apacheDeclaration NWSSLTrustedCerts NWSSLUpgradeable SecureListen 146syn keyword apacheDeclaration PerlModule PerlRequire PerlTaintCheck PerlWarn 147syn keyword apacheDeclaration PerlSetVar PerlSetEnv PerlPassEnv PerlSetupEnv 148syn keyword apacheDeclaration PerlInitHandler PerlPostReadRequestHandler PerlHeaderParserHandler 149syn keyword apacheDeclaration PerlTransHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler 150syn keyword apacheDeclaration PerlTypeHandler PerlFixupHandler PerlHandler PerlLogHandler 151syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildExitHandler 152syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler 153syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader 154syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag 155syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)[^>]*>" contains=apacheAnything 156syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBadHeader ProxyBlock ProxyDomain ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPass ProxyPassMatch ProxyPassReverse ProxyPassReverseCookieDomain ProxyPassReverseCookiePath ProxyPreserveHost ProxyReceiveBufferSize ProxyRemote ProxyRemoteMatch ProxyRequests ProxyTimeout ProxyVia 157syn keyword apacheDeclaration RewriteBase RewriteCond RewriteEngine RewriteLock RewriteLog RewriteLogLevel RewriteMap RewriteOptions RewriteRule 158syn keyword apacheOption inherit 159syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase 160syn keyword apacheDeclaration LoadFile LoadModule 161syn keyword apacheDeclaration CheckSpelling CheckCaseOnly 162syn 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 163syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>" 164syn keyword apacheOption builtin sem 165syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):" 166syn 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\)\>" 167syn keyword apacheOption optional optional_no_ca 168syn keyword apacheDeclaration ExtendedStatus 169syn keyword apacheDeclaration SuexecUserGroup 170syn keyword apacheDeclaration UserDir 171syn keyword apacheDeclaration CookieDomain CookieExpires CookieName CookieStyle CookieTracking 172syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965 173syn match apacheSection "<\/\=\(<IfVersion\)[^>]*>" contains=apacheAnything 174syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP 175 176" Define the default highlighting 177 178hi def link apacheAllowOverride apacheDeclaration 179hi def link apacheAllowOverrideValue apacheOption 180hi def link apacheAuthType apacheDeclaration 181hi def link apacheAuthTypeValue apacheOption 182hi def link apacheOptionOption apacheOption 183hi def link apacheDeclaration Function 184hi def link apacheAnything apacheOption 185hi def link apacheOption Number 186hi def link apacheComment Comment 187hi def link apacheFixme Todo 188hi def link apacheLimitSectionKeyword apacheLimitSection 189hi def link apacheLimitSection apacheSection 190hi def link apacheSection Label 191hi def link apacheMethodOption Type 192hi def link apacheAllowDeny Include 193hi def link apacheAllowDenyValue Identifier 194hi def link apacheOrder Special 195hi def link apacheOrderValue String 196hi def link apacheString String 197hi def link apacheError Error 198hi def link apacheUserID Number 199 200 201let b:current_syntax = "apache" 202