mirror of
https://github.com/scopatz/nanorc
synced 2024-11-22 08:35:39 +01:00
First nanorc commit.
This commit is contained in:
commit
2d2bb4ba12
57
Readme.rst
Normal file
57
Readme.rst
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
***************************************
|
||||||
|
Improved Nano Syntax Highlighting Files
|
||||||
|
***************************************
|
||||||
|
|
||||||
|
This repository holds {lang}.nanorc files that have imporved
|
||||||
|
definitions of syntax highlighting for various languages.
|
||||||
|
These should be placed inside of the ``~/.nano/`` directory.
|
||||||
|
|
||||||
|
Once there you should add the languages you want to your
|
||||||
|
nano configuration file ``~/.nanorc``. For example,
|
||||||
|
my config file includes::
|
||||||
|
|
||||||
|
## C/C++
|
||||||
|
include "~/.nano/c.nanorc"
|
||||||
|
|
||||||
|
## Fortran
|
||||||
|
include "~/.nano/fortran.nanorc"
|
||||||
|
|
||||||
|
## HTML
|
||||||
|
include "~/.nano/html.nanorc"
|
||||||
|
|
||||||
|
## Patch files
|
||||||
|
include "~/.nano/patch.nanorc"
|
||||||
|
|
||||||
|
## Manpages
|
||||||
|
include "~/.nano/man.nanorc"
|
||||||
|
|
||||||
|
## Perl
|
||||||
|
include "~/.nano/perl.nanorc"
|
||||||
|
|
||||||
|
## Python
|
||||||
|
include "~/.nano/python.nanorc"
|
||||||
|
|
||||||
|
## reST
|
||||||
|
include "~/.nano/reST.nanorc"
|
||||||
|
|
||||||
|
## Ruby
|
||||||
|
include "~/.nano/ruby.nanorc"
|
||||||
|
|
||||||
|
## Bourne shell scripts
|
||||||
|
include "~/.nano/sh.nanorc"
|
||||||
|
|
||||||
|
## makefile .am
|
||||||
|
include "~/.nano/gentoo.nanorc"
|
||||||
|
|
||||||
|
## TeX
|
||||||
|
include "~/.nano/tex.nanorc"
|
||||||
|
|
||||||
|
## CSS
|
||||||
|
include "~/.nano/css.nanorc"
|
||||||
|
|
||||||
|
## php
|
||||||
|
include "~/.nano/php.nanorc"
|
||||||
|
|
||||||
|
## XML
|
||||||
|
include "~/.nano/xml.nanorc"
|
||||||
|
|
44
apacheconf.nanorc
Normal file
44
apacheconf.nanorc
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Apache files
|
||||||
|
syntax "apacheconf" "httpd\.conf|mime\.types|vhosts\.d\\*"
|
||||||
|
color yellow ".+"
|
||||||
|
color brightcyan "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
|
||||||
|
color brightcyan "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
|
||||||
|
color brightcyan "(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"
|
||||||
|
color brightcyan "(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"
|
||||||
|
color brightcyan "(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"
|
||||||
|
color brightcyan "(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases)"
|
||||||
|
color brightcyan "(AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl|AuthName|AuthType|AuthUserFile)"
|
||||||
|
color brightcyan "(BrowserMatch|BrowserMatchNoCase|BS2000Account|BufferedLogs|CacheDefaultExpire|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheExpiryCheck)"
|
||||||
|
color brightcyan "(CacheFile|CacheForceCompletion|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheIgnoreCacheControl|CacheIgnoreHeaders)"
|
||||||
|
color brightcyan "(CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire|CacheMaxFileSize|CacheMinFileSize|CacheNegotiatedDocs|CacheRoot|CacheSize|CacheTimeMargin)"
|
||||||
|
color brightcyan "(CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckSpelling|ChildPerUserID|ContentDigest|CookieDomain|CookieExpires|CookieLog|CookieName)"
|
||||||
|
color brightcyan "(CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultType)"
|
||||||
|
color brightcyan "(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize|Deny|Directory|DirectoryIndex|DirectoryMatch|DirectorySlash)"
|
||||||
|
color brightcyan "(DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|Example|ExpiresActive|ExpiresByType)"
|
||||||
|
color brightcyan "(ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FileETag|Files|FilesMatch|ForceLanguagePriority|ForceType|ForensicLog|Group|Header)"
|
||||||
|
color brightcyan "(HeaderName|HostnameLookups|IdentityCheck|IfDefine|IfModule|IfVersion|ImapBase|ImapDefault|ImapMenu|Include|IndexIgnore|IndexOptions|IndexOrderDefault)"
|
||||||
|
color brightcyan "(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout)"
|
||||||
|
color brightcyan "(LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize)"
|
||||||
|
color brightcyan "(LDAPTrustedCA|LDAPTrustedCAType|Limit|LimitExcept|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine)"
|
||||||
|
color brightcyan "(LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|Location|LocationMatch|LockFile|LogFormat|LogLevel|MaxClients|MaxKeepAliveRequests)"
|
||||||
|
color brightcyan "(MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MCacheMaxObjectCount|MCacheMaxObjectSize)"
|
||||||
|
color brightcyan "(MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads)"
|
||||||
|
color brightcyan "(MMapFile|ModMimeUsePathInfo|MultiviewsMatch|NameVirtualHost|NoProxy|NumServers|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|PassEnv|PidFile)"
|
||||||
|
color brightcyan "(ProtocolEcho|Proxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyIOBufferSize|ProxyMatch|ProxyMaxForwards|ProxyPass|ProxyPassReverse)"
|
||||||
|
color brightcyan "(ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia|ReadmeName|Redirect|RedirectMatch)"
|
||||||
|
color brightcyan "(RedirectPermanent|RedirectTemp|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader)"
|
||||||
|
color brightcyan "(Require|RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC)"
|
||||||
|
color brightcyan "(Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen)"
|
||||||
|
color brightcyan "(SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetEnv|SetEnvIf|SetEnvIfNoCase|SetHandler)"
|
||||||
|
color brightcyan "(SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath)"
|
||||||
|
color brightcyan "(SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions)"
|
||||||
|
color brightcyan "(SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite)"
|
||||||
|
color brightcyan "(SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire)"
|
||||||
|
color brightcyan "(SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|SuexecUserGroup|ThreadLimit)"
|
||||||
|
color brightcyan "(ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnsetEnv|UseCanonicalName|User|UserDir|VirtualDocumentRoot)"
|
||||||
|
color brightcyan "(VirtualDocumentRootIP|VirtualHost|VirtualScriptAlias|VirtualScriptAliasIP|Win32DisableAcceptEx|XBitHack)"
|
||||||
|
color yellow "<[^>]+>"
|
||||||
|
color brightcyan "</?[A-Za-z]+"
|
||||||
|
color brightcyan "(<|</|>)"
|
||||||
|
color green "\"(\\.|[^\"])*\""
|
||||||
|
color white "#.*"
|
17
asm.nanorc
Normal file
17
asm.nanorc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
## Here is an example for assembler.
|
||||||
|
##
|
||||||
|
syntax "asm" "\.(S|s|asm)$"
|
||||||
|
color red "\<[A-Z_]{2,}\>"
|
||||||
|
color brightgreen "\.(data|subsection|text)"
|
||||||
|
color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
|
||||||
|
color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
|
||||||
|
icolor brightred "^[[:space:]]*[.0-9A-Z_]*:"
|
||||||
|
color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||||
|
## Highlight strings (note: VERY resource intensive)
|
||||||
|
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||||
|
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||||
|
## Highlight comments
|
||||||
|
color brightblue "//.*"
|
||||||
|
color brightblue start="/\*" end="\*/"
|
||||||
|
## Highlight trailing whitespace
|
||||||
|
color ,green "[[:space:]]+$"
|
36
c.nanorc
Normal file
36
c.nanorc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
## Here is an example for C/C++.
|
||||||
|
##
|
||||||
|
syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
|
||||||
|
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||||
|
color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
|
||||||
|
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
|
||||||
|
color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
|
||||||
|
color green "\<(for|if|while|do|else|case|default|switch)\>"
|
||||||
|
color green "\<(try|throw|catch|operator|new|delete)\>"
|
||||||
|
color brightmagenta "\<(goto|continue|break|return)\>"
|
||||||
|
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
|
||||||
|
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||||
|
|
||||||
|
##
|
||||||
|
## GCC builtins
|
||||||
|
color green "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||||
|
|
||||||
|
#Operator Color
|
||||||
|
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||||
|
|
||||||
|
#Parenthetical Color
|
||||||
|
color magenta "[(){}]" "\[" "\]"
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
## String highlighting. You will in general want your comments and
|
||||||
|
## strings to come last, because syntax highlighting rules will be
|
||||||
|
## applied in the order they are read in.
|
||||||
|
color cyan "<[^= ]*>" ""(\\.|[^"])*""
|
||||||
|
##
|
||||||
|
## This string is VERY resource intensive!
|
||||||
|
color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||||
|
|
||||||
|
## Comment highlighting
|
||||||
|
color brightblue "//.*"
|
||||||
|
color brightblue start="/\*" end="\*/"
|
10
conf.nanorc
Normal file
10
conf.nanorc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## Here is an example for nanorc files.
|
||||||
|
##
|
||||||
|
syntax "conf" "\.c[o]?nf$"
|
||||||
|
## Possible errors and parameters
|
||||||
|
## Strings
|
||||||
|
icolor white ""(\\.|[^"])*""
|
||||||
|
## Comments
|
||||||
|
icolor brightblue "^[[:space:]]*#.*$"
|
||||||
|
icolor cyan "^[[:space:]]*##.*$"
|
||||||
|
|
10
css.nanorc
Normal file
10
css.nanorc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## Here is an example for css files.
|
||||||
|
##
|
||||||
|
|
||||||
|
syntax "css" "\.css$"
|
||||||
|
color brightred "."
|
||||||
|
color brightyellow start="\{" end="\}"
|
||||||
|
color brightwhite start=":" end="[;^\{]"
|
||||||
|
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
|
||||||
|
color brightblue start="\/\*" end="\\*/"
|
||||||
|
color green ";|:|\{|\}"
|
46
fortran.nanorc
Normal file
46
fortran.nanorc
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
## Here is an example for Fortran 90/95
|
||||||
|
|
||||||
|
syntax "fortran" "\.(f|f90|f95)$"
|
||||||
|
|
||||||
|
#color red "\<[A-Z_]a[0-9A-Z_]+\>"
|
||||||
|
color red "\<[0-9]+\>"
|
||||||
|
|
||||||
|
icolor green "\<(action|advance|all|allocatable|allocated|any|apostrophe)\>"
|
||||||
|
icolor green "\<(append|asis|assign|assignment|associated|character|common)\>"
|
||||||
|
icolor green "\<(complex|data|default|delim|dimension|double precision)\>"
|
||||||
|
icolor green "\<(elemental|epsilon|external|file|fmt|form|format|huge)\>"
|
||||||
|
icolor green "\<(implicit|include|index|inquire|integer|intent|interface)\>"
|
||||||
|
icolor green "\<(intrinsic|iostat|kind|logical|module|none|null|only)>"
|
||||||
|
icolor green "\<(operator|optional|pack|parameter|pointer|position|private)\>"
|
||||||
|
icolor green "\<(program|public|real|recl|recursive|selected_int_kind)\>"
|
||||||
|
icolor green "\<(selected_real_kind|subroutine|status)\>"
|
||||||
|
|
||||||
|
icolor cyan "\<(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\>"
|
||||||
|
icolor cyan "\<(close|contains|count|cpu_time|cshift|date_and_time)\>"
|
||||||
|
icolor cyan "\<(deallocate|digits|dot_product|eor|eoshift|function|iachar)\>"
|
||||||
|
icolor cyan "\<(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\>"
|
||||||
|
icolor cyan "\<(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\>"
|
||||||
|
icolor cyan "\<(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\>"
|
||||||
|
icolor cyan "\<(open|pad|present|print|product|pure|quote|radix)\>"
|
||||||
|
icolor cyan "\<(random_number|random_seed|range|read|readwrite|replace)\>"
|
||||||
|
icolor cyan "\<(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\>"
|
||||||
|
icolor cyan "\<(spread|sum|system_clock|target|transfer|transpose|trim)\>"
|
||||||
|
icolor cyan "\<(ubound|unpack|verify|write|tiny|type|use|yes)\>"
|
||||||
|
|
||||||
|
icolor yellow "\<(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\>"
|
||||||
|
icolor yellow "\<(end?select|.eqv.|forall|if|lge|lgt|lle|llt|.neqv.|.not.)\>"
|
||||||
|
icolor yellow "\<(.or.|repeat|select case|then|where|while)\>"
|
||||||
|
|
||||||
|
icolor magenta "\<(continue|cycle|exit|go?to|result|return)\>"
|
||||||
|
|
||||||
|
#Operator Color
|
||||||
|
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||||
|
|
||||||
|
#Parenthetical Color
|
||||||
|
color magenta "[(){}]" "\[" "\]"
|
||||||
|
|
||||||
|
## String highlighting.
|
||||||
|
icolor brightblue "<[^= ]*>" ""(\\.|[^"])*""
|
||||||
|
|
||||||
|
## Comment highlighting
|
||||||
|
icolor brightred "!.*"
|
50
gentoo.nanorc
Normal file
50
gentoo.nanorc
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
## Here is an example for ebuilds/eclasses
|
||||||
|
##
|
||||||
|
syntax "ebuild" "\.e(build|class)$"
|
||||||
|
## All the standard portage functions
|
||||||
|
color brightgreen "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
|
||||||
|
## Highlight bash related syntax
|
||||||
|
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\>"
|
||||||
|
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||||
|
color green "-(e|d|f|r|g|u|w|x|L)\>"
|
||||||
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
||||||
|
## Highlight variables ... official portage ones in red, all others in bright red
|
||||||
|
color brightred "\$\{?[a-zA-Z_0-9]+\}?"
|
||||||
|
color red "\<(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\>"
|
||||||
|
color red "\<(S|D|T|PV|PF|P|PN|A)\>" "\<C(XX)?FLAGS\>" "\<LDFLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
|
||||||
|
## Highlight portage commands
|
||||||
|
color magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
|
||||||
|
color brightblue "\<e(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\>"
|
||||||
|
color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>" "\<unpack\>"
|
||||||
|
color brightblue "\<(do|new)(ins|s?bin|doc|lib(|\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
|
||||||
|
color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
|
||||||
|
color brightblue "prepall(|docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
|
||||||
|
color brightblue "\<(|doc|ins|exe)into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
|
||||||
|
## Highlight common commands used in ebuilds
|
||||||
|
color blue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\>"
|
||||||
|
## Highlight comments (doesnt work that well)
|
||||||
|
color yellow "#.*$"
|
||||||
|
## Highlight strings (doesnt work that well)
|
||||||
|
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
|
||||||
|
## Trailing space is bad!
|
||||||
|
color ,green "[[:space:]]+$"
|
||||||
|
|
||||||
|
## Here is an example for Portage control files
|
||||||
|
##
|
||||||
|
syntax "/etc/portage" "\.(keywords|mask|unmask|use)$"
|
||||||
|
## Base text:
|
||||||
|
color green "^.+$"
|
||||||
|
## Use flags:
|
||||||
|
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
|
||||||
|
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
|
||||||
|
## Likely version numbers:
|
||||||
|
color magenta "-[[:digit:]].*([[:space:]]|$)"
|
||||||
|
## Accepted arches:
|
||||||
|
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
|
||||||
|
color white "[[:space:]][~-]?\*"
|
||||||
|
## Categories:
|
||||||
|
color cyan "^[[:space:]]*.*/"
|
||||||
|
## Masking regulators:
|
||||||
|
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
|
||||||
|
## Comments:
|
||||||
|
color yellow "#.*$"
|
24
groff.nanorc
Normal file
24
groff.nanorc
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
## Here is an example for groff.
|
||||||
|
##
|
||||||
|
syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac."
|
||||||
|
## The argument of .ds or .nr
|
||||||
|
color cyan "^\.(ds|nr) [^[[:space:]]]*"
|
||||||
|
## Single character escapes
|
||||||
|
color brightmagenta "\\."
|
||||||
|
## Highlight the argument of \f or \s in the same color
|
||||||
|
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
|
||||||
|
## Newlines
|
||||||
|
color cyan "(\\|\\\\)n(.|\(..)"
|
||||||
|
color cyan start="(\\|\\\\)n\[" end="]"
|
||||||
|
## Requests
|
||||||
|
color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
|
||||||
|
## Comments
|
||||||
|
color yellow "^\.\\".*$"
|
||||||
|
## Strings
|
||||||
|
color green "(\\|\\\\)\*(.|\(..)"
|
||||||
|
color green start="(\\|\\\\)\*\[" end="]"
|
||||||
|
## Characters
|
||||||
|
color brightred "\\\(.."
|
||||||
|
color brightred start="\\\[" end="]"
|
||||||
|
## Macro arguments
|
||||||
|
color brightcyan "\\\\\$[1-9]"
|
5
html.nanorc
Normal file
5
html.nanorc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
## Here is a short example for HTML.
|
||||||
|
##
|
||||||
|
syntax "html" "\.html$"
|
||||||
|
color blue start="<" end=">"
|
||||||
|
color red "&[^;[[:space:]]]*;"
|
12
java.nanorc
Normal file
12
java.nanorc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## Here is an example for Java.
|
||||||
|
##
|
||||||
|
syntax "java" "\.java$"
|
||||||
|
color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
|
||||||
|
color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
|
||||||
|
color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
|
||||||
|
color red ""[^"]*""
|
||||||
|
color yellow "\<(true|false|null)\>"
|
||||||
|
color blue "//.*"
|
||||||
|
color blue start="/\*" end="\*/"
|
||||||
|
color brightblue start="/\*\*" end="\*/"
|
||||||
|
color ,green "[[:space:]]+$"
|
9
man.nanorc
Normal file
9
man.nanorc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
## Here is an example for manpages.
|
||||||
|
##
|
||||||
|
syntax "man" "\.[1-9]x?$"
|
||||||
|
color green "\.(S|T)H.*$"
|
||||||
|
color brightgreen "\.(S|T)H" "\.TP"
|
||||||
|
color brightred "\.(BR?|I[PR]?).*$"
|
||||||
|
color brightblue "\.(BR?|I[PR]?|PP)"
|
||||||
|
color brightwhite "\\f[BIPR]"
|
||||||
|
color yellow "\.(br|DS|RS|RE|PD)"
|
4
mutt.nanorc
Normal file
4
mutt.nanorc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
## Here is an example for quoted emails (under e.g. mutt).
|
||||||
|
##
|
||||||
|
syntax "mutt"
|
||||||
|
color green "^>.*"
|
16
nanorc.nanorc
Normal file
16
nanorc.nanorc
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
## Here is an example for nanorc files.
|
||||||
|
##
|
||||||
|
syntax "nanorc" "\.?nanorc$"
|
||||||
|
## Possible errors and parameters
|
||||||
|
icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
|
||||||
|
## Keywords
|
||||||
|
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace|wordbounds)\>"
|
||||||
|
icolor green "^[[:space:]]*(set|unset|include|syntax)\>"
|
||||||
|
## Colors
|
||||||
|
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||||
|
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||||
|
## Strings
|
||||||
|
icolor white ""(\\.|[^"])*""
|
||||||
|
## Comments
|
||||||
|
icolor brightblue "^[[:space:]]*#.*$"
|
||||||
|
icolor cyan "^[[:space:]]*##.*$"
|
10
patch.nanorc
Normal file
10
patch.nanorc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## Here is an example for patch files.
|
||||||
|
##
|
||||||
|
syntax "patch" "\.(patch|diff)$"
|
||||||
|
color brightgreen "^\+.*"
|
||||||
|
color green "^\+\+\+.*"
|
||||||
|
color brightblue "^ .*"
|
||||||
|
color brightred "^-.*"
|
||||||
|
color red "^---.*"
|
||||||
|
color brightyellow "^@@.*"
|
||||||
|
color magenta "^diff.*"
|
11
perl.nanorc
Normal file
11
perl.nanorc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
## Here is an example for Perl.
|
||||||
|
##
|
||||||
|
syntax "perl" "\.p[lm]$"
|
||||||
|
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||||
|
color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
|
||||||
|
icolor cyan start="[$@%]" end="( |[^0-9A-Z_]|-)"
|
||||||
|
color yellow "".*"|qq\|.*\|"
|
||||||
|
color white "[sm]/.*/"
|
||||||
|
color white start="(^use| = new)" end=";"
|
||||||
|
color green "#.*"
|
||||||
|
color yellow start="<< 'STOP'" end="STOP"
|
20
php.nanorc
Normal file
20
php.nanorc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
## PHP syntax highlighting
|
||||||
|
##
|
||||||
|
syntax "php" "\.php$" "\.php[2345s]$" "\.phtml$"
|
||||||
|
#functions
|
||||||
|
color brightmagenta "([A-Za-z0-9])"
|
||||||
|
#numbers
|
||||||
|
color brightblue "[0-9]"
|
||||||
|
#special
|
||||||
|
color brightwhite "(^|[^A-Za-z0-9])(<\?php|\?>|var|and|or|default|class|extends|true|false|global|function|new|switch|case|break|next|prev|elseif|if|else|foreach|for|as|do|while|exit|die|declare|require_once|require|include_once|include|return|echo|static|array|isset)([^A-Za-z0-9])"
|
||||||
|
#types
|
||||||
|
color brightred "([^A-Za-z0-9])|[^A-Za-z](null|int|string|float|bool|object|resource)[^A-Za-z0-9_]+[^A-Za-z]"
|
||||||
|
#strings
|
||||||
|
color brightyellow ""(\\.|[^\"])*""
|
||||||
|
color brightyellow "'(\\.|[^\'])*'"
|
||||||
|
#Variables
|
||||||
|
color brightcyan "\$[]\[A-Za-z0-9_'\"]*"
|
||||||
|
#comments
|
||||||
|
color green "//.*"
|
||||||
|
color green "#.*"
|
||||||
|
color green start="/\*" end="\*/"
|
15
pov.nanorc
Normal file
15
pov.nanorc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
## Here is an example for POV-Ray.
|
||||||
|
##
|
||||||
|
syntax "pov" "\.(pov|POV|povray|POVRAY)$"
|
||||||
|
color brightcyan "^[[:space:]]*#[[:space:]]*(declare)"
|
||||||
|
color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
|
||||||
|
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
|
||||||
|
color brightyellow "\<(fog_type|fog_offset|fog_alt|rgb|distance|transform)\>"
|
||||||
|
color brightred "^\<(texture)\>"
|
||||||
|
color brightred "\<(light_source|background)\>"
|
||||||
|
color brightred "\<(fog|object|camera)\>"
|
||||||
|
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||||
|
color brightmagenta "\<(union|group|subgroup)\>"
|
||||||
|
## Comment highlighting
|
||||||
|
color brightblue "//.*"
|
||||||
|
color brightblue start="/\*" end="\*/"
|
24
python.nanorc
Normal file
24
python.nanorc
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
## Here is an example for Python.
|
||||||
|
##
|
||||||
|
syntax "python" "\.py$"
|
||||||
|
icolor brightred "def [0-9A-Z_]+"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Keyword Color
|
||||||
|
color green "\<(and|as|assert|class|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|try|while|with)\>"
|
||||||
|
color brightmagenta "\<(continue|break|return)\>"
|
||||||
|
|
||||||
|
#Operator Color
|
||||||
|
color yellow "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
|
||||||
|
|
||||||
|
#Parenthetical Color
|
||||||
|
color magenta "[(){}]" "\[" "\]"
|
||||||
|
|
||||||
|
#String Color
|
||||||
|
color cyan "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
|
||||||
|
color cyan "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
|
||||||
|
color cyan start=""""[^"]" end=""""" start="'''[^']" end="'''"
|
||||||
|
|
||||||
|
#Comment Color
|
||||||
|
color brightblue "#.*$"
|
27
reST.nanorc
Normal file
27
reST.nanorc
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
## For reST
|
||||||
|
syntax "rest" "\.rest$" "\.rst$"
|
||||||
|
# italics
|
||||||
|
#color magenta "\*[^*]\*"
|
||||||
|
# bold
|
||||||
|
color red "\*\*[^*]+\*\*"
|
||||||
|
# code block
|
||||||
|
color brightred "::"
|
||||||
|
# link reference
|
||||||
|
color blue "`[^`]+`_{1,2}"
|
||||||
|
# code
|
||||||
|
color yellow "``[^`]+``"
|
||||||
|
# directives or comments
|
||||||
|
color cyan "^\.\. .*$"
|
||||||
|
# anon link targets
|
||||||
|
color cyan "^__ .*$"
|
||||||
|
# h1
|
||||||
|
color yellow "^###+$"
|
||||||
|
color yellow "^\*\*\*+$"
|
||||||
|
# h2
|
||||||
|
color magenta "^===+$"
|
||||||
|
# h3
|
||||||
|
color red "^---+$"
|
||||||
|
# h4
|
||||||
|
color green "^\^\^\^+$"
|
||||||
|
# h5
|
||||||
|
color blue "^"""+$"
|
30
ruby.nanorc
Normal file
30
ruby.nanorc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
## Here is an example for Ruby.
|
||||||
|
##
|
||||||
|
syntax "ruby" "\.rb$"
|
||||||
|
## Asciibetical list of reserved words
|
||||||
|
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
|
||||||
|
## Constants
|
||||||
|
color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
|
||||||
|
## Ruby "symbols"
|
||||||
|
icolor magenta "([ ]|^):[0-9A-Z_]+\>"
|
||||||
|
## Some unique things we want to stand out
|
||||||
|
color brightyellow "\<(__FILE__|__LINE__)\>"
|
||||||
|
## Regular expressions
|
||||||
|
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
|
||||||
|
## Shell command expansion is in `backticks` or like %x{this}. These are
|
||||||
|
## "double-quotish" (to use a perlism).
|
||||||
|
color brightblue "`[^`]*`" "%x\{[^}]*\}"
|
||||||
|
## Strings, double-quoted
|
||||||
|
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
|
||||||
|
## Expression substitution. These go inside double-quoted strings,
|
||||||
|
## "like #{this}".
|
||||||
|
color brightgreen "#\{[^}]*\}"
|
||||||
|
## Strings, single-quoted
|
||||||
|
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
|
||||||
|
## Comments
|
||||||
|
color cyan "#[^{].*$" "#$"
|
||||||
|
color brightcyan "##[^{].*$" "##$"
|
||||||
|
## "Here" docs
|
||||||
|
color green start="<<-?'?EOT'?" end="^EOT"
|
||||||
|
## Some common markers
|
||||||
|
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"
|
13
sh.nanorc
Normal file
13
sh.nanorc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
## Here is an example for Bourne shell scripts.
|
||||||
|
##
|
||||||
|
syntax "sh" "\.sh$"
|
||||||
|
icolor brightgreen "^[0-9A-Z_]+\(\)"
|
||||||
|
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
|
||||||
|
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
|
||||||
|
color green "-[Ldefgruwx]\>"
|
||||||
|
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
|
||||||
|
color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
|
||||||
|
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
|
||||||
|
color cyan "(^|[[:space:]])#.*$"
|
||||||
|
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
|
||||||
|
#color ,green "[[:space:]]+$"
|
7
tex.nanorc
Normal file
7
tex.nanorc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
## Here is a short example for TeX files.
|
||||||
|
##
|
||||||
|
syntax "tex" "\.tex$" "bib" "\.bib$" "cls" "\.cls$"
|
||||||
|
icolor green "\\.|\\[A-Z]*"
|
||||||
|
color magenta "[{}]"
|
||||||
|
color blue "%.*"
|
||||||
|
color blue start="\\begin\{comment\}" end="\\end\{comment\}"
|
11
xml.nanorc
Normal file
11
xml.nanorc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
## Here is an example for xml files.
|
||||||
|
##
|
||||||
|
|
||||||
|
syntax "ml" ".*\.([jrs]?html?|xml|sgml?)$"
|
||||||
|
color white "^.+$"
|
||||||
|
color green start="<" end=">"
|
||||||
|
color cyan "<[^> ]+"
|
||||||
|
color cyan ">"
|
||||||
|
color yellow start="<!DOCTYPE" end="[/]?>"
|
||||||
|
color yellow start="<!--" end="-->"
|
||||||
|
color red "&[^;]*;"
|
Loading…
Reference in New Issue
Block a user