Menu

.conf syntax highlighting

2006-11-25
2012-11-13
  • Nobody/Anonymous

    I'm suprised there wasnt a file for .conf syntax highlighting for Apache users. So we can edit our settings easily. If someone has made one please post it here and share with the others ;)

     
    • R. Scheurer

      R. Scheurer - 2007-04-26

      Here's a "quick hack" syntax highlighting file for Apache .conf files.

      Please note: the list of keywords is not complete ...

      <NotepadPlus>
          <UserLang name="Apache Conf" ext="conf">
              <Settings>
                  <Global caseIgnored="no" />
                  <TreatAsSymbol comment="no" commentLine="yes" />
                  <Prefix words1="no" words2="no" words3="no" words4="no" />
              </Settings>
              <KeywordLists>
                  <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
                  <Keywords name="Folder+">&lt;Directory &lt;Folder &lt;IfModule &lt;FilesMatch &lt;Files &lt;VirtualHost &lt;Location &lt;Limit &lt;LimitExcept</Keywords>
                  <Keywords name="Folder-">&lt;/Directory &lt;/Folder &lt;/IfModule &lt;/FilesMatch &lt;/Files &lt;/VirtualHost &lt;/Location &lt;/Limit &lt;/LimitExcept</Keywords>
                  <Keywords name="Operators">&quot; + &gt;</Keywords>
                  <Keywords name="Comment">1 2 0#</Keywords>
                  <Keywords name="Words1">ServerRoot ThreadsPerChild MaxRequestsPerChild Listen LoadModule DocumentRoot ServerAdmin ServerName ErrorLog LogLevel CustomLog Options AllowOverride Order Deny Allow Satisfy DirectoryIndex LogFormat ScriptAlias DefaultType TypesConfig AddType AddHandler AddOutputFilter MIMEMagicFile ErrorDocument SSLRandomSeed NameVirtualHost ServerAlias SetHandler ExtendedStatus UserDir Alias IndexOptions AddIconByEncoding AddIconByType AddIcon DefaultIcon ReadmeName IndexIgnore HeaderName Timeout KeepAlive MaxKeepAliveRequests KeepAliveTimeout UseCanonicalName AccessFileName ServerTokens ServerSignature HostnameLookups AliasMatch SetEnvIf RedirectMatch LanguagePriority ForceLanguagePriority DavLockDB Dav AuthType AuthName AuthUserFile AuthGroupFile Require BrowserMatch PidFile LockFile StartServers MinSpareServers MaxSpareServers MaxClients MinSpareThreads MaxSpareThreads StartThreads MaxRequestsPerThread ThreadStackSize MaxThreads MaxMemFree Require SSLRandomSeed SSLPassPhraseDialog SSLSessionCache SSLSessionCacheTimeout SSLMutex TransferLog SSLEngine SSLCipherSuite SSLCertificateFile SSLCertificateKeyFile SSLCertificateChainFile SSLCACertificatePath SSLCACertificateFile SSLCARevocationPath SSLCARevocationFile SSLVerifyClient SSLVerifyDepth SSLRequire SSLOptions Redirect ScriptInterpreterSource EnableMMAP EnableSendfile</Keywords>
                  <Keywords name="Words2">Include</Keywords>
                  <Keywords name="Words3">none warn from allow,deny deny,allow all None Deny,Allow Allow,Deny On on GET POST OPTIONS MultiViews SymLinksIfOwnerMatch IncludesNoExec Limit FileInfo AuthConfig FancyIndexing HTMLTable VersionSort Off off EMail Full full Prefer user Fallback prefer fallback Digest digest Basic basic redirect-carefully default builtin permanent temporary registry</Keywords>
                  <Keywords name="Words4">FollowSymLinks Includes Indexes ExecCGI  MultiViews StdEnvVars</Keywords>
              </KeywordLists>
              <Styles>
                  <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FF0080" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="FF0080" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD2" styleID="6" fgColor="FF8040" bgColor="FFFFFF" fontName="" fontStyle="1" />
                  <WordsStyle name="KEYWORD3" styleID="7" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="COMMENT LINE" styleID="2" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" />
                  <WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER1" styleID="14" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
                  <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
              </Styles>
          </UserLang>
      </NotepadPlus>

       
    • Nobody/Anonymous

      I'm looking for the same thing as well.

      I might actually work on this provided I'm not hungover.

       
  • Lemonhead

    Lemonhead - 2010-01-15

    Yes, totally.
    httpd.conf, .htaccess, for all this stuff I would love to have dedicated syntax colors.
    I can use XML instead, but it only does half of the job.

     
  • Lemonhead

    Lemonhead - 2010-01-15

    sorry, didn't notice there are more replies. In the search results it only showed the starting post.
    I'm going to try the solution by hrs.

     
  • Lemonhead

    Lemonhead - 2010-01-15

    It works!
    I added a few keywords for my htaccess:
    RewriteRule RewriteBase RewriteCond php_value ExpiresActive ExpiresDefault RewriteEngine

     
  • Dejan Kozina

    Dejan Kozina - 2010-01-17

    Very nice and useful indeed! Thank you for sharing.
    My 0.2p: replace <UserLang name="Apache Conf" ext="conf"> with <UserLang name="Apache Conf" ext="conf htaccess">, so .htaccess files are recognized automatically.

     
  • cchris

    cchris - 2010-01-18

    Will update the hosted file tonight, cannot do so from office.

    CChris

     
  • Thell Fowler

    Thell Fowler - 2010-02-03

    There is an official Scintilla lexer for .conf; you can easily create your own external lexer to use it.

    Or use the NppExternalLexer plugin which includes the official .conf lexer  (and custom PowerShell that is much better than the built in one, imo - but I'm a little biased ;)  ).  In section II of the readme included with that plugin is a step by step for making your own if you want, iirc it is a 10 step process and might take about 15-20 minutes if you already have a windows dev environment setup.

     
  • Dejan Kozina

    Dejan Kozina - 2010-03-11

    After checking my own httpd.conf I found some more keywords:
    RewriteMap AddDefaultCharset DefaultLanguage RewriteLog RewriteLogLevel User Group AddLanguade AddCharset ForceType php_flag
    and some other relevant only if you have mod_security:
    SecRuleEngine SecRequestBodyAccess SecResponseBodyAccess SecResponseBodyMimeType SecResponseBodyLimit SecDefaultAction SecServerSignature SecComponentSignature SecUploadDir SecUploadKeepFiles SecRule SecAuditEngine SecAuditLogRelevantStatus SecAuditLogType SecAuditLog SecAuditLogParts SecArgumentSeparator SecCookieFormat SecRequestBodyInMemoryLimit SecDebugLog SecDebugLogLevel SecDataDir SecTmpDir LimitRequestBody LimitRequestFields LimitRequestFieldSize LimitRequestLine

     
  • Dejan Kozina

    Dejan Kozina - 2010-03-11

    Seems that I can't type straight tonight: change AddLanguade into AddLanguage