nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

perl.nanorc (2143B)


      1 ## Syntax highlighting for Perl.
      2 
      3 syntax perl "\.p[lm]$"
      4 header "^#!.*perl"
      5 magic "Perl script"
      6 comment "#"
      7 
      8 # Functions.
      9 color red "\<(abs|accept|alarm|atan2|bin(d|mode)|bless|caller|ch(dir|mod|op|omp|own|r|root)|close(dir)?|connect|cos|crypt)\>"
     10 color red "\<(dbm(close|open)|defined|delete|dump|each|eof|eval(bytes)?|exec|exists|exp|fc|fcntl|fileno|flock|fork|format|formline)\>"
     11 color red "\<(get(c|login|peername|pgrp|ppid|priority|(gr|pw)nam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport))\>"
     12 color red "\<(([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|glob|gmtime|grep|hex|import|index|int|ioctl|join)\>"
     13 color red "\<(keys|kill|lc|lcfirst|length|link|listen|local(time)?|lock|log|lstat|map|mkdir|msg(ctl|get|snd|rcv)|oct)\>"
     14 color red "\<(open(dir)?|ord|pack|pipe|pop|pos|printf?|prototype|push|q|qq|qr|qx|qw|quotemeta|rand|read(dir|line|link|pipe)?)\>"
     15 color red "\<(recv|redo|ref|rename|require|reset|reverse|rewinddir|rindex|rmdir|say|scalar|seek(dir)?|select|sem(ctl|get|op))\>"
     16 color red "\<(send|set(pgrp|priority|sockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|splice|split)\>"
     17 color red "\<(sprintf|sqrt|srand|state?|study|substr|symlink|sys(call|open|read|seek|tem|write)|tell(dir)?|tied?|times?|try?)\>"
     18 color red "\<(truncate|uc|ucfirst|umask|un(def|link|pack|shift|tie)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
     19 
     20 # Control flow, logical operators, declarations.
     21 color magenta "\<(continue|die|do|else|elsif|exit|for(each)?|fork|goto|if|last|next|return|unless|until|while)\>"
     22 color magenta "\<(and|cmp|eq|ge|gt|isa|le|lt|ne|not|or|x|xor)\>"
     23 color magenta "\<(my|no|our|package|sub|use)\>"
     24 
     25 # Variable names.
     26 color cyan "[$%&@]([[:alpha:]_][[:alnum:]_]*|\^[][[:upper:]?\^_]|[[:digit:]]+)\>"
     27 color cyan "[$%&@]\{(\^?[[:alpha:]_][[:alnum:]_]*|\^[][?\^][[:digit:]]+)\}"
     28 color cyan "[$%&@]([][!"#'()*+,.:;<=>?`|~-]|\{[][!-/:-@\`|~]\})|\$[$%&@]"
     29 color cyan "(^|[[:blank:]])[$%@][/\]"
     30 
     31 # Strings.
     32 color yellow "".*"|qq\|.*\|"
     33 
     34 color white "[smy]/.*/"
     35 color white start="(^use| = new)" end=";"
     36 
     37 # Comments.
     38 color green "(^|[[:blank:]])#.*"