## Nano v2.0.7 syntax highlighting file by S.R. Santos (18 July 2008) ## Note that syntax highlighting rules are applied in the order that they are read ## For DNA sequence in FASTA format syntax "fasta" "\.fasta$" "\.fas$" color brightwhite "^\>.*" color brightgreen "[Aa]" color brightred "[Tt]" color brightblue "[Cc]" color brightyellow "[Gg]" ## For DNA sequence in NEXUS/PAUP format syntax "nexus" "\.nexus$" "\.nex$" color brightgreen "[Aa]" color brightred "[Tt]" color brightblue "[Cc]" color brightyellow "[Gg]" color brightwhite "(^[ ])\{?[0-9A-Z_!@#$*?-]+\}?" color brightwhite start="\[" end="\]" color brightred "(#NEXUS|End|;)" color brightyellow "(Dimensions|Format|Matrix)" color brightcyan "(Begin DATA|ntax|nchar|datatype|gap)" color brightred "\=\{?[0-9A-Z_!@#$*?-]+\}?" ## For GNU 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)" color 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:]]+$" ## For C/C++ files 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 brightyellow "\<(for|if|while|do|else|case|default|switch)\>" color brightyellow "\<(try|throw|catch|operator|new|delete)\>" color magenta "\<(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}'" ## For GCC builtins color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" color brightblue "//.*" color brightblue start="/\*" end="\*/" # Highlight Trailing whitespace color ,green "[[:space:]]+$" ## For groff files 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]" ## For HTML files syntax "html" "\.html$" "\.htm$" color brightcyan start="<" end=">" color red "&[^;[[:space:]]]*;" ## 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 brightmagenta ""(\\.|[^"])*"" "'(\\.|[^'])*'" color brightgreen ";|:|\{|\}" ## For HTML urls syntax "urls" color brightmagenta "^.*$" color cyan "^(1[0-9][0-9]|20[256]|30[45]).*$" color green "^20[03].*$" color brightyellow "^(201|30[0-37]).*$" color brightred "^(204|[45][0-9][0-9]|666).*$" ## For PHP files (example #1) syntax "php2" "\.php[2345s~]?$" color brightblue "(.*)\(" color blue "\$[a-zA-Z_0-9$]*|[=!<>]" color green "(var|class|function|echo|case|break|default|exit|switch|if|else|elseif|@|while)\s" color green "[.,{}();]" color red "('.*')|(\".*\")" color brightyellow "(#.*|//.*)$" color brightyellow start="/\*" end="\*/" color brightblue "(<\?(php)?|\?>)" color white start="\?>" end="<\?(php)?" ## For PHP files (example #2) syntax "php" "\.php[2345s~]?$" # php markings color brightgreen "(<\?(php)?|\?>)" # functions color white "\<[a-z_]*\(" # types color green "\<(var|float|global|double|bool|char|int|enum|const)\>" # structure color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>" # control flow color magenta "\<(goto|continue|break|return)\>" # strings color brightyellow "<[^= ]*>" ""(\.|[^"])*"" # comments color brightblue "//.*" color brightblue start="/\*" end="\*/" # Trailing whitespace color ,green "[[:space:]]+$" ## For XML files syntax "ml" ".*\.([jrs]?html?|xml|sgml?|lhtml|opml|kdevelop|vcproj|glade|xsd|plist|gcs|dtd|dcl)$" "catalog$" "docbook$" color white "^.+$" color green start="<" end=">" color cyan "<[^> ]+" color cyan ">" color yellow start="" color yellow start="" color red "&[^;]*;" ## For TeX files syntax "tex" "\.tex$" icolor green "\\.|\\[A-Z]*" color magenta "[{}]" color blue "%.*" ## For Java files 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:]]+$" ## 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)" ## 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:]]*##.*$" ## For patch files syntax "patch" "\.(patch|diff)$" color brightgreen "^\+.*" color green "^\+\+\+.*" color brightblue "^ .*" color brightred "^-.*" color red "^---.*" color brightyellow "^@@.*" color magenta "^diff.*" ## For perl scripts 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" ## For python scripts syntax "python" "\.py$" icolor brightblue "def [0-9A-Z_]+" color brightcyan "\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>" color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''" color brightred "#.*$" ## For ruby scripts 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|\?\?\?)" ## For Bourne shell scripts ending with .sh 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:]]+$" ## For Bourne shell scripts used in software compiling syntax "shlike" "\.(m4|sub|guess)$" "missing$" "configure\.ac$" "config\.(charset|rpath|status)$" "configure$" 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 ""(\\.|[^"])*"" "'(\\.|[^'])*'" ## For shell profile files syntax "profiles" "\.profile$" "\.bashrc$" "\profile$" color red "'(\\.|[^'])*'" color brightcyan ""(\\.|[^\"])*"" color brightyellow "[a-zA-Z0-9\_]+=" color brightmagenta "\<(sudo)\>" color cyan "\<(export)\>" "\<(alias)\>" color brightred "\<(umask)\>.*$" color green "#.*$" ## For MySQL configuration files syntax "mysql" "my.cnf" icolor yellow "^[[:space:]]*[0-9\/a-z_-]*" color cyan start="\[" end="\]" color green "#.*$" ## Default conditions if nothing matches from above syntax "default" color green "^#.*" color brightgreen "^##.*" color yellow "^###.*"