Mercurial > repos > other > linux
changeset 90:4342e7b19fa8
Standardise nanorc colouring with other file types
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Apr 2018 17:20:47 +0100 |
parents | a5810e6bed7e |
children | 9f3d2d765a0f |
files | nanorc nanorc.d/nanorc.nanorc |
diffstat | 2 files changed, 32 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/nanorc Mon Apr 02 17:15:26 2018 +0100 +++ b/nanorc Mon Apr 02 17:20:47 2018 +0100 @@ -4,7 +4,7 @@ set autoindent ## Nanorc files -include "/usr/share/nano/nanorc.nanorc" +include "~/.nanorc.d/nanorc.nanorc" ## Patch files include "~/.nanorc.d/patch.nanorc"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nanorc.d/nanorc.nanorc Mon Apr 02 17:20:47 2018 +0100 @@ -0,0 +1,31 @@ +## Here is an example for nanorc files. + +syntax nanorc "\.?nanorc$" +comment "#" + +# Possible errors and parameters +icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|i?color|extendsyntax).*$" + +# Keywords +icolor brightmagenta "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cutfromcursor|fill[[:space:]]+-?[[:digit:]]+|historylog|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|trimblanks|unix|view|wordbounds)\>" +icolor yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|selected|status|title)color)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" +icolor brightmagenta "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|selectedcolor|speller|statuscolor|titlecolor|whitespace|wordchars)[[:space:]]+" +icolor brightmagenta "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+([[:alpha:]]+|".*")[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" +icolor brightmagenta "^[[:space:]]*unbind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)" +icolor brightmagenta "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|comment|linter|formatter)[[:space:]]+.*$" +icolor brightmagenta "^[[:space:]]*(syntax|linter|formatter)[[:space:]]+[^[:blank:]]+" +icolor magenta "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|extendsyntax)\>" + +# Strings +color yellow "".+"([[:space:]]|$)" + +# Colors +icolor brightmagenta "^[[: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)=" + +# Comments +color green "(^|[[:space:]]+)#.*$" +color green "^[[:space:]]*##.*$" + +# Trailing whitespace +color ,green "[[:space:]]+$"