| ## Syntax highlighting for nanorc files. |
|
|
| syntax nanorc "[/.]nanorc(\.in)?$" |
| comment "#" |
|
|
| # Everything that does not get recolored is invalid |
| color brightred ".*" |
|
|
| # Color names |
| color yellow "^[[:blank:]]*(i?color|set[[:blank:]]+(error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color)[[:blank:]]+(bold,)?(italic,)?((bright|light)?(white|black|red|blue|green|yellow|magenta|cyan)|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3})?(,((light)?(white|black|red|blue|green|yellow|magenta|cyan)|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte|rosy|beet|plum|sea|sky|slate|teal|sage|brown|ocher|sand|tawny|brick|crimson|grey|gray|#[[:xdigit:]]{3}))?\>" |
|
|
| # The arguments of two special commands |
| color bold,purple "^[[:blank:]]*include[[:blank:]]+[^[:blank:]"]+" |
| color lime "^*extendsyntax+++(i?color|header|magic|comment|formatter|linter|tabgives)+.*" |
| |
| # The arguments of commands |
| color brightgreen "^*(set|unset)+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines|casesensitive|colonparsing|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|solosidescroll|stateflags|tabstospaces|trimblanks|unix|whitespacedisplay|wordbounds|zap|zero)\>" |
| color brightgreen "^*set+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|minicolor|numbercolor|operatingdir|promptcolor|punct|quotestr|scrollercolor|selectedcolor|speller|spotlightcolor|statuscolor|stripecolor|titlecolor|whitespace|wordchars)+" |
| color brightgreen "^*set+(fill+-?+|(guidestripe|tabsize)+*)\>" |
| color brightgreen "^*bind+((\^(|/@\^_`-]|Space)|(-)?-|-(|Space|Left|Right|Up|Down))|F(|1|2)|Ins|Del)+(+|".*")+(main|help|search|replace(with)?|yesno|gotoline|writeout|insert|execute|browser|whereisfile|gotodir|spell|linter|all)\>" |
| color brightgreen "^*unbind+((\^(|/@\^_`-]|Space)|(-)?-|-(|Space|Left|Right|Up|Down))|F(|1|2)|Ins|Del)+(main|help|search|replace(with)?|yesno|gotoline|writeout|insert|execute|browser|whereisfile|gotodir|spell|linter|all)\>" |
| color brightgreen "^*extendsyntax+++" |
| color brightgreen "^*(syntax++|(formatter|linter)+.+)" |
| |
| # Strings |
| color brightmagenta "(start=)?".+"" |
| |
| # Function names in string binds |
| color crimson "\{(help|cancel|exit|savefile|writeout|discardbuffer|insert|where(is|was)|find(previous|next|bracket)|replace)\}" |
| color crimson "\{(cut|copy|paste|zap|chopword(left|right)|cutrestoffile|execute|mark|speller|linter|formatter|(full)?justify)\}" |
| color crimson "\{(location|gotoline|(begin|end)para|comment|complete|(un)?indent|wordcount|(record|run)macro|anchor|undo|redo)\}" |
| color crimson "\{(left|right|up|down|home|end|scroll(left|right|up|down)|page(up|down)|(top|bottom)row|center|cycle|(prev|next)(word|block|anchor|buf))\}" |
| color crimson "\{(tab|enter|delete|backspace|verbatim|refresh|suspend|casesens|regexp|backwards|older|newer|(dos|mac)format)\}" |
| color crimson "\{(append|prepend|backup|flip(goto|replace|execute|pipe|convert|newbuffer)|browser|gotodir|(first|last)(file|line))\}" |
| color crimson "\{(nohelp|constantshow|softwrap|linenumbers|whitespacedisplay|nosyntax|zero)\}" |
| color crimson "\{(smarthome|autoindent|cutfromcursor|breaklonglines|tabstospaces|mouse|\{|\})\}" |
| |
| # Commands |
| color green "^*((un)?(bind|set)|include|syntax|header|magic|comment|formatter|linter|tabgives|extendsyntax)\>" |
| color magenta "^*i?color\>|(start=|end=)" |
| |
| # Control codes |
| color bold,pink "" |
| |
| # Comments |
| color brightblue "^*#.*|#.{0,2}.*" |
| color cyan "^*##.*" |
| |
| # Trailing whitespace |
| color ,green "+$" |
| |