# .nanorc set nowrap set nohelp set const set quickblank set historylog set speller "aspell check" # ^T set tabsize 2 set tabstospaces set morespace # Syntax Highlighting # much of this is adapted from people far smarter than me. # I've tweaked and adapted to make it work for me, keeping # the colours as consistant as possible. #== Mail, Config files and others == syntax "other" "\.*$" # quotes in cyan color cyan "^>.*" # alternate highlights color yellow "^\+.*" color magenta "^\-.*" # Wiki Headers in red color cyan "^\=\=.*" # email addresses and URLs in yellow color yellow "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" color yellow "(https|http|file|ftp):/[^ ]+" # comments in green color green "#.*" # sent or general mail headers color green "^Date\:.*|^From\:.*|^To\:.*|^Subject\:.*|^Cc\:.*|^Bcc\:.*|^Reply-To\:.*" color green "^References\:.*|^MIME-Version\:.*|^Content-Type\:.*|^Content-Disposition\:.*" color green "^In-Reply-To\:.*|^User-Agent\:.*|^Status\:.*|^Content-Length\:.*|^Lines\:.*|^Message-ID\:.*" # received headers color red "^Received\:.*|^Comment\:.*|^DomainKey-.*|^Mailing-List\:.*|^Delivered-To\:.*|^List-Id\:.*" color red "^X-*.*|Content-Transfer-Encoding\:.*|^Precedence\:.*|^Sender\:.*" color red "^Return-Path\:.*|^List-Unsubscribe\:.*" # forum tags become cyan color cyan start="\[" end="\]" #== 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|seekdir|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|our|sub|use|package|can|isa)\>" color cyan "[$@%].[a-z]+" color cyan "[$@%]_" #color yellow "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" #color yellow "(https|http|file|ftp):/[^ ]+" color green "#.*" #== Javascript == syntax "JavaScript" "\.(js)$" color white "^.+$" color magenta "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>" color magenta "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?" color magenta "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?" # loops, arrays, booleans and that kinda stuff color cyan "\<(break|case|catch|continue|default|delete|do|else|finally)\>" color cyan "\<(for|function|if|in|instanceof|new|null|return|switch)\>" color cyan "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>" color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>" color red "\<(Number|Object|RegExp|String)\>" color red "\<(true|false)\>" # all brackets in cyan color cyan "<\{^\} ]+" color cyan "\{" color cyan "\}" color cyan "<\(^\) ]+" color cyan "\(" color cyan "\)" color cyan "<\[^\] ]+" color cyan "\[" color cyan "\]" # misc operators in yellow color yellow "\,|\*|\.|\=|\+|\-|\:" # anytihng quoted in white color white "L?\"(\\"|[^"])*\"" color white "L?'(\'|[^'])*'" # I can't remember what this is for, is that bad? color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]" #comments in green color green start="/\*" end="\*/" color green "//.*$" #== Style Sheets == syntax "css" "\.css$" color cyan "." # anything in {} defaults to yellow color yellow start="\{" end="\}" # properties become white color white start=":" end="[;^\{]" # meta-wass-names become red color red ":active|:focus|:hover|:link|:visited|:link|:after|:before|$" # comments in green color green start="\/\*" end="\\*/" # brackets and operators in cyan color cyan ";|:|\{|\}" #== HTML and XML (XHTML, WML) == syntax "ml" ".*\.(html|phtml|xhtml|php|wml|xml|xul|rdf|rss|cont)$" color white "^.+$" # anything inside tags default to yellow color yellow start="<" end=">" # anything in quotes becomes white color white ""[^"]+"" # tags themselves become cyan color cyan "<[^> ]+" color cyan "<" color cyan ">" # doctype and comments in green color green start="" color green start="" color green start="" # © and it's mates color red "&[^;]*;" # for php color red "<\?.+\?>" color red "<\?" color red "\?>" # XML bollocks color white start="" color white "" #== TeX or LaTeX == syntax "TeX" "\.tex$" color cyan "\\.|\\[A-Za-z]*" color yellow start="\{" end="\}" color cyan "[{}]" color green "%.*"