From 3e31ea5a3f8b1b39d7afd6e5430a21e59e3c86cd Mon Sep 17 00:00:00 2001 From: Markus Hoffmann Date: Wed, 5 Jun 2019 12:45:35 +0200 Subject: [PATCH 01/10] Added nanorc file for X11-Basic (BASIC programming language) Made it more or less from scratch because no other BASIC language file existed (or at least I have not found any). --- x11basic.nanorc | 172 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 x11basic.nanorc diff --git a/x11basic.nanorc b/x11basic.nanorc new file mode 100644 index 0000000..2a8d236 --- /dev/null +++ b/x11basic.nanorc @@ -0,0 +1,172 @@ +## Sytax highlighting for nano and pico for X11-Basic. (c) Markus Hoffmann 2019 + +# This file is part of X11-Basic, the basic interpreter for Unix/X +# ====================================================================== +# X11-Basic is free software and comes with NO WARRANTY - read the file +# COPYING for details + +syntax "x11basic" "\.(bas|xbas|LST|BAS)$" + +# Variable names + +icolor brightwhite "\<[A-Z_][A-Za-z0-9_]*(|\$|\%|\&|\||\(\))\>" + +# system vars +icolor cyan "\<(CCSAPLID|CCSERR|COLS|CRSCOL|CRSLIN|CTIMER|ERR|FALSE)\>" +icolor cyan "\<(GPS_ALT|GPS_LAT|GPS_LON|MOUSEK|MOUSES|MOUSEX|MOUSEY)\>" +icolor cyan "\<(PC|PI|ROWS|SP|STIMER|TIMER|TRUE)\>" + +# system string vars +icolor cyan "\<(DATE|FILEEVENT|INKEY|TERMINALNAME|TIME|TRACE)\$" + +#special system vars +icolor cyan "\<(ANDROID|GPIO|GPS|SENSOR|WIN32|UNIX)\?" + + +# system array vars + +# regular functions + +icolor green "\<(ABS|ACOS|ACOSH|ADD|AND|ARG|ARRPTR|ASC|ASIN|ASINH|ATAN|ATANH|ATN)\(" +icolor green "\<(BCHG|BCLR|BSET|BTST|BYTE)\(" +icolor green "\<(CALL|CALLD|CARD|CBRT|CEIL|COLOR_RGB|COMBIN|CONJ|COS|COSH|CRC|CVD|CVF|CVI|CVL|CVS)\(" +icolor green "\<(DEG|DET|DEVICE|DIV|DPEEK)\(" +icolor green "\<(EOF|EVAL|EVEN|EXEC|EXIST|EXP|EXPM1)\(" +icolor green "\<(FACT|FIX|FLOOR|FORK|FORM_ALERT|FORM_CENTER|FORM_DIAL|FORM_DO|FRAC|FREEFILE)\(" +icolor green "\<(GAMMA|GASDEV|GCD|GET_COLOR|GLOB|GPIO|GRAY)\(" +icolor green "\<(HYPOT)\(" +icolor green "\<(IMAG|INODE|INP|INSTR|INT|INVERT|IOCTL)\(" +icolor green "\<(JULIAN)\(" +icolor green "\<(LCM|LEN|LGAMMA|LISTSELECT|LN|LOC|LOF|LOG|LOG10|LOG1P|LOGB|LPEEK|LTEXTLEN)\(" +icolor green "\<(MALLOC|MAX|MIN|MOD|MODE|MSHRINK|MUL)\(" +icolor green "\<(NEXTPRIME|NLINK|NOT)\(" +icolor green "\<(OBJC_DRAW|OBJC_FIND|OBJC_OFFSET|ODD|OR)\(" +icolor green "\<(PEEK|POINT|POWM|PRED|PTST)\(" +icolor green "\<(RAD|RAND|RANDOM|REAL|REALLOC|RINSTR|RND|ROL|ROOT|ROR|ROUND|RSRC_GADDR)\(" +icolor green "\<(SENSOR|SGN|SHL|SHM_ATTACH|SHM_MALLOC|SHR|SIN|SINH|SIZE|SQR|SQRT|SRAND|SUB|SUCC|SWAP|SYM_ADR)\(" +icolor green "\<(TALLY|TAN|TANH|TRUNC)\(" +icolor green "\<(UBOUND)\(" +icolor green "\<(VAL|VARIAT|VARPTR|VRFY)\(" +icolor green "\<(WORD|WORT_SEP)\(" +icolor green "\<(XOR)\(" + +# question functions +icolor green "\<(DIM|EVENT|INP|TYP|VAL)\?\(" + +# special functions + +icolor green "\<(INP)\%\(" +icolor green "\<(INP)\&\(" + + + +# string functions +icolor green "\<(ARID|ARIE)\$\(" +icolor green "\<(BIN|BWTD|BWTE)\$\(" +icolor green "\<(CALL|CHR|COMPRESS)\$\(" +icolor green "\<(DECLOSE|DECRYPT|DIR)\$\(" +icolor green "\<(ENCLOSE|ENCRYPT|ENV|ERR)\$\(" +icolor green "\<(FSFIRST|FSNEXT)\$\(" +icolor green "\<(HASH|HEX)\$\(" +icolor green "\<(INLINE|INPUT)\$\(" +icolor green "\<(JULDATE)\$\(" +icolor green "\<(LEFT|LEFTOF|LINEINPUT|LOWER)\$\(" +icolor green "\<(MID|MKA|MKD|MKF|MKI|MKL|MKS|MTFD|MTFE)\$\(" +icolor green "\<(OCT)\$\(" +icolor green "\<(PARAM|PNGDECODE|PNGENCODE|PRG)\$\(" +icolor green "\<(REPLACE|REVERSE|RADIX|RIGHT|RIGHTOF|RLD|RLE)\$\(" +icolor green "\<(SIGN|SPACE|STR|STRING|SYSTEM)\$\(" +icolor green "\<(TERMINALNAME|TRIM)\$\(" +icolor green "\<(UCASE|UNCOMPRESS|UNIXDATE|UNIXTIME|UPPER|USING)\$\(" +icolor green "\<(WORD)\$\(" +icolor green "\<(XTRIM)\$\(" + +# array functions + +icolor green "\<(0|1|CONVOLUT|CVA|FFT|INV|SMUL|SOLVE|TRANS)\(" + + + +# special commands + +icolor brightmagenta "(^|^[[:space:]]*)(DIM|LOCAL|LET)\>" +icolor cyan "(^|^[[:space:]]*)DATA.*$" + +icolor red "(^|^[[:space:]]*)ENDFUNCTION\>" +icolor red "(^|^[[:space:]]*)(RETURN|BREAK|CONTINUE|EXIT\ IF)\>" +icolor red "(^|^[[:space:]]*)(FUNCTION|PROCEDURE|DEFFN)\>" + +icolor blue "(^|^[[:space:]]*)(endselect|select|default|endif|else\ if|else|case|do|loop|next|for|if|while|wend|repeat|until|goto|gosub|spawn|void)\>" +icolor brightred "(^|^[[:space:]]*)(END|QUIT|STOP|TRON|TROFF|ECHO|EDIT|NEW|RUN)\>" + + +# regular commands + +icolor brightgreen "(^|^[[:space:]]*)(ABSOLUTE|ADD|AFTER|ALERT|ARRAYCOPY|ARRAYFILL)\>" +icolor brightgreen "(^|^[[:space:]]*)(BEEP|BELL|BGET|BLOAD|BMOVE|BOTTOMW|BOUNDARY|BOX|BPUT|BSAVE)\>" +icolor brightgreen "(^|^[[:space:]]*)(CALL|CHAIN|CHDIR|CHMOD|CIRCLE|CLEAR|CLEARW|CLIP|CLOSE|CLOSEW|CLR|CLS|COLOR|CONNECT|COPYAREA|CURVE)\>" +icolor brightgreen "(^|^[[:space:]]*)(DEC|DEFFILL|DEFLINE|DEFMARK|DEFMOUSE|DEFTEXT|DELAY|DIV|DPOKE|DRAW|DUMP)\>" +icolor brightgreen "(^|^[[:space:]]*)(ELLIPSE|ERASE|ERROR|EVAL|EVENT|EVERY|EXEC)\>" +icolor brightgreen "(^|^[[:space:]]*)(FFT|FILESELECT|FILL|FIT|FIT_LINEAR|FIT_POLY|FLUSH|FREE|FULLW)\>" +icolor brightgreen "(^|^[[:space:]]*)(GET|GET_GEOMETRY|GET_LOCATION|GET_SCREENSIZE|GPIO|GPRINT|GPS|GRAPHMODE)\>" +icolor brightgreen "(^|^[[:space:]]*)(HELP|HIDEK|HIDEM|HOME)\>" +icolor brightgreen "(^|^[[:space:]]*)(INC|INFOW|INPUT)\>" +icolor brightgreen "(^|^[[:space:]]*)(KEYEVENT|KILL)\>" +icolor brightgreen "(^|^[[:space:]]*)(LINE|LINEINPUT|LINK|LIST|LOAD|LOCATE|LPOKE|LTEXT)\>" +icolor brightgreen "(^|^[[:space:]]*)(MEMDUMP|MENU|MENUDEF|MENUKILL|MENUSET|MERGE|MFREE|MKDIR|MOUSE|MOUSEEVENT|MOTIONEVENT|MOVEW|MSYNC|MUL)\>" +icolor brightgreen "(^|^[[:space:]]*)(NOOP|NOP|NOROOTWINDOW)\>" +icolor brightgreen "(^|^[[:space:]]*)(OBJC_ADD|OBJC_DELETE|ON|OPEN|OPENW|OUT)\>" +icolor brightgreen "(^|^[[:space:]]*)(PAUSE|PBOX|PCIRCLE|PELLIPSE|PIPE|PLAYSOUND|PLAYSOUNDFILE|PLIST|PLOT|POKE|POLYFILL|POLYLINE|POLYMARK|PRBOX|PRINT|PUT|PUTBACK|PUT_BITMAP)\>" +icolor brightgreen "(^|^[[:space:]]*)(RANDOMIZE|RBOX|READ|RECEIVE|RELSEEK|RENAME|RESTORE|RMDIR|ROOTWINDOW|RSRC_FREE|RSRC_LOAD)\>" +icolor brightgreen "(^|^[[:space:]]*)(SAVE|SAVESCREEN|SAVEWINDOW|SCOPE|SCREEN|SEEK|SEND|SENSOR|SETFONT|SETMOUSE|SGET|SHELL|SHM_DETACH|SHM_FREE|SHOWK|SHOWM|SHOEPAGE|SIZEW|SORT|SOUND|SPEAK|SPLIT|SPUT|SUB|SWAP|SYSTEM)\>" +icolor brightgreen "(^|^[[:space:]]*)(TEXT|TITLEW|TOPW|TOUCH)\>" +icolor brightgreen "(^|^[[:space:]]*)(UNLINK|UNMAP|USEWINDOW)\>" +icolor brightgreen "(^|^[[:space:]]*)(VERSION|VSYNC)\>" +icolor brightgreen "(^|^[[:space:]]*)(WATCH|WAVE|WORT_SEP)\>" +icolor brightgreen "(^|^[[:space:]]*)(XLOAD|XRUN)\>" + +## commands with a blank in it + +icolor brightblue "(^|^[[:space:]]*)(ON\ ERROR\ CONT)" +icolor brightblue "(^|^[[:space:]]*)(ON\ BREAK\ CONT)" +icolor brightred "(^|^[[:space:]]*)(ECHO\ (ON|OFF))" + + +## keywords +icolor brightblue "\<(and|or|not|to|xor|not|then|step|var|tab|using)\>" + +## operators +color white "[+*=\^]" "<" ">" "/" "-" +color brightred "[@\~]" + + +## number constants +icolor brightyellow "\b(([1-9][0-9]+)|0+)\.[0-9]+j?\b" "\b([1-9][0-9]*[Lj]?)\b" "\b0o?[0-7]*L?\b" "\b0x[1-9a-f][0-9a-f]*L?\b" "\b0b[01]+\b" +icolor brightyellow "[\ ,\(]\#[1-9][0-9]*\b" + +## parentheses +color magenta "[(){}]" "\[" "\]" + +# labels +icolor red "(^|^[[:space:]]*)[^\ ^=.]*:" + +# Comments. +color yellow "(^|^[[:space:]]*)'.*$" +icolor yellow "(^|^[[:space:]]*)REM.*$" +color yellow "!.*$" + +icolor brightwhite,blue "(^|^[[:space:]]*)PROGRAM.*$" + +#shebang line +icolor brightwhite,green "^\#\!.*$" + + + +# Strings +color yellow "<[^= ]*>" ""(\\.|[^"])*"" + +## trailing spaces +color ,green "[[:space:]]+$" + +## reminders +color brightwhite,yellow "(FIXME|TODO|XXX)" From 5ca686ee690ea60dd02c197be1c3f228bae38b96 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Wed, 5 Jun 2019 23:27:13 -0700 Subject: [PATCH 02/10] Update sh.nanord with all keyword/builtins --- sh.nanorc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sh.nanorc b/sh.nanorc index a3854c9..42afa6e 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -1,13 +1,16 @@ ## Here is an example for Bourne shell scripts. ## -syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_profile" "bash_profile" "revise\..+$" +syntax "SH" "\.sh$" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_login" "\.bash_logout" "\.bash_profile" "bash_profile" "\.profile" "revise\..+$" header "^#!.*/(env +)?(ba)?sh( |$)" - -color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>" +## keywords: +color green "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|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)\>" +## builtins: +color brightblue "\<(alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|set|shift|shopt|source|suspend|test|times|trap|type|typeset|ulimit|umask|unalias|unset|wait)\>" +## not buitins: +## cat|chmod|chown|cp|env|grep|install|ln|make|mkdir|mv|rm|sed|tar|touch icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)" icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?" color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" From c57d1f7911afd4c960bab13504d5b1dec91f9190 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Wed, 5 Jun 2019 23:40:13 -0700 Subject: [PATCH 03/10] Add missing builtins to sh.nanorc See http://manpages.ubuntu.com/manpages/disco/man7/bash-builtins.7.html#synopsis --- sh.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh.nanorc b/sh.nanorc index 42afa6e..4eeb07d 100644 --- a/sh.nanorc +++ b/sh.nanorc @@ -8,7 +8,7 @@ color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color green "-[Ldefgruwx]\>" color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" ## builtins: -color brightblue "\<(alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|set|shift|shopt|source|suspend|test|times|trap|type|typeset|ulimit|umask|unalias|unset|wait)\>" +color brightblue "\<(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|mapfile|popd|printf|pushd|pwd|read|readarray|readonly|return|set|shift|shopt|source|suspend|test|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)\>" ## not buitins: ## cat|chmod|chown|cp|env|grep|install|ln|make|mkdir|mv|rm|sed|tar|touch icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)" From 390e14b023e7f8bd1a9e11a17cec36d90ba774a0 Mon Sep 17 00:00:00 2001 From: Aryan Ebrahimpour Date: Fri, 21 Jun 2019 13:56:09 +0430 Subject: [PATCH 04/10] Add fsharp --- fsharp.nanorc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 fsharp.nanorc diff --git a/fsharp.nanorc b/fsharp.nanorc new file mode 100644 index 0000000..c5d8cc4 --- /dev/null +++ b/fsharp.nanorc @@ -0,0 +1,33 @@ +syntax "F#" "\.fs$" "\.fsx$" + +# Type and Module Definitions +color brightgreen "type +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" +color brightgreen "module +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" +color brightmagenta "\<(List|Seq|Array|list|seq|array|ref|in|out)\>" +color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Attributes + +# Annotation +color magenta "@[A-Za-z]+" + +# Basic Types +color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" + +# Keywords +color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" + +color red "[-+/*=<>?:!~%&|]" +color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" +color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" +color magenta "\\([btnfr]|'|\"|\\)" +color magenta "\\u[A-Fa-f0-9]{4}" + +# Comments +color brightblack "(^|[[:space:]])//.*" +color brightblack start="/\*" end="\*/" +color brightblack start="\(\*" end="\*\)" +color brightwhite,cyan "TODO:?" + +color ,green "[[:space:]]+$" +color ,red " + +| + +" + +color white start="``" end="``" \ No newline at end of file From 221f368c2c7c1c5b798159b1b54f828ad3a6885f Mon Sep 17 00:00:00 2001 From: Aryan Ebrahimpour Date: Fri, 21 Jun 2019 14:17:13 +0430 Subject: [PATCH 05/10] update rules --- fsharp.nanorc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fsharp.nanorc b/fsharp.nanorc index c5d8cc4..7be77cc 100644 --- a/fsharp.nanorc +++ b/fsharp.nanorc @@ -3,21 +3,22 @@ syntax "F#" "\.fs$" "\.fsx$" # Type and Module Definitions color brightgreen "type +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" color brightgreen "module +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" -color brightmagenta "\<(List|Seq|Array|list|seq|array|ref|in|out)\>" +color brightmagenta "\<(List|Seq|Array|Option|Choice|Map|list|seq|array|option|choice|ref|in|out)\>" +color brightgreen "<+[A-Za-z0-9'^]+ *((:) +[A-Za-z0-9'^.]+)?>" color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Attributes # Annotation color magenta "@[A-Za-z]+" # Basic Types -color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" +color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" # Keywords -color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" +color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" color red "[-+/*=<>?:!~%&|]" color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" -color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" +color yellow ""(\\.|[^"])*"" # String color magenta "\\([btnfr]|'|\"|\\)" color magenta "\\u[A-Fa-f0-9]{4}" @@ -30,4 +31,7 @@ color brightwhite,cyan "TODO:?" color ,green "[[:space:]]+$" color ,red " + +| + +" +color red "#if .+" +color red "#endif" + color white start="``" end="``" \ No newline at end of file From 18d96c1ab81dfc304d896031dba726a93de8b3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 24 Jun 2019 12:21:11 +0200 Subject: [PATCH 06/10] Remove useless checks, formatting --- install.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index afb92d3..c26cc80 100755 --- a/install.sh +++ b/install.sh @@ -8,10 +8,7 @@ fi _fetch_sources(){ wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip - if [ ! -d ~/.nano/ ] - then - mkdir ~/.nano/ - fi + mkdir -p ~/.nano/ cd ~/.nano/ || exit unzip -o "/tmp/nanorc.zip" @@ -21,11 +18,8 @@ _fetch_sources(){ } _update_nanorc(){ - if [ ! -f ~/.nanorc ] - then - touch ~/.nanorc - fi - + touch ~/.nanorc + # add all includes from ~/.nano/nanorc if they're not already there while read -r inc; do if ! grep -q "$inc" "${NANORC_FILE}"; then @@ -42,10 +36,10 @@ NANORC_FILE=~/.nanorc case "$1" in -l|--lite) - UPDATE_LITE=1;; + UPDATE_LITE=1;; -h|--help) - echo "Install script for nanorc syntax highlights" - echo "Call with -l or --lite to update .nanorc with secondary precedence to existing .nanorc includes" + echo "Install script for nanorc syntax highlights" + echo "Call with -l or --lite to update .nanorc with secondary precedence to existing .nanorc includes" ;; esac From eff6072bf55227f2bed76b334250c99ed1cd98cd Mon Sep 17 00:00:00 2001 From: PhilipRoman Date: Wed, 26 Jun 2019 23:03:20 +0300 Subject: [PATCH 07/10] Add "least", "fast" and "max" C fixed-width types This commit adds support for the remaining C99/C++11 fixed-width types: u?int_fastN_t u?int_leastN_t u?intmax_t --- c.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c.nanorc b/c.nanorc index e51c99b..2550299 100644 --- a/c.nanorc +++ b/c.nanorc @@ -3,7 +3,7 @@ syntax "C" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" "\.(def)$" color brightred "\<[A-Z_][0-9A-Z_]+\>" color green "\<(float|double|bool|char|wchar_t|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" -color green "\<((s?size)|(char(16|32))|((u_?)?int(8|16|32|64|ptr)))_t\>" +color green "\<((s?size)|(char(16|32))|((u_?)?int(_fast|_least)?(8|16|32|64))|u?int(max|ptr))_t\>" color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>" color green "\<(for|if|while|do|else|case|default|switch)\>" color green "\<(try|throw|catch|operator|new|delete)\>" From 531b706114950b4347bf94fc7a200f978167dcb2 Mon Sep 17 00:00:00 2001 From: Daniel Harbor Date: Fri, 28 Jun 2019 21:43:05 -0700 Subject: [PATCH 08/10] Fix fsharp.nanorc formatting issues --- fsharp.nanorc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fsharp.nanorc b/fsharp.nanorc index 7be77cc..90a7796 100644 --- a/fsharp.nanorc +++ b/fsharp.nanorc @@ -5,7 +5,8 @@ color brightgreen "type +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" color brightgreen "module +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" color brightmagenta "\<(List|Seq|Array|Option|Choice|Map|list|seq|array|option|choice|ref|in|out)\>" color brightgreen "<+[A-Za-z0-9'^]+ *((:) +[A-Za-z0-9'^.]+)?>" -color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Attributes +# Attributes +color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Annotation color magenta "@[A-Za-z]+" @@ -18,9 +19,10 @@ color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|de color red "[-+/*=<>?:!~%&|]" color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" -color yellow ""(\\.|[^"])*"" # String color magenta "\\([btnfr]|'|\"|\\)" color magenta "\\u[A-Fa-f0-9]{4}" +# String +color yellow ""(\\.|[^"])*"" # Comments color brightblack "(^|[[:space:]])//.*" @@ -34,4 +36,4 @@ color ,red " + +| + +" color red "#if .+" color red "#endif" -color white start="``" end="``" \ No newline at end of file +color white start="``" end="``" From c545f9ef5eae350287a8d7f9bd3f59f50fa74bba Mon Sep 17 00:00:00 2001 From: Skruppy Date: Tue, 9 Jul 2019 19:16:52 +0200 Subject: [PATCH 09/10] Add `constantshow` to nanorc.nanorc --- nanorc.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanorc.nanorc b/nanorc.nanorc index cecaa5b..1c9b7c7 100644 --- a/nanorc.nanorc +++ b/nanorc.nanorc @@ -4,7 +4,7 @@ syntax "Nanorc" "\.?nanorc$" ## Possible errors and parameters icolor brightred "^[[:space:]]*((un)?set|include|syntax|i?color).*$" ## Keywords -icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|poslog|positionlog|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|speller|suspend|suspendenable|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\>" +icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|constantshow|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|poslog|positionlog|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|speller|suspend|suspendenable|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds)\>" icolor green "^[[:space:]]*(bind|set|unset|syntax|header|include|magic)\>" ## Colors icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" From a27f953341f1baa75511b9bc5a3dcc2371971080 Mon Sep 17 00:00:00 2001 From: Tim Austin Date: Sun, 21 Jul 2019 21:40:02 -0700 Subject: [PATCH 10/10] basic elixir highlighting --- elixir.nanorc | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 elixir.nanorc diff --git a/elixir.nanorc b/elixir.nanorc new file mode 100644 index 0000000..25b0cb0 --- /dev/null +++ b/elixir.nanorc @@ -0,0 +1,50 @@ +## Here is an example for Elixir. +## +syntax "Elixir" "\.ex$" "\.exs$" +header "^#!.*/(env +)?elixir( |$)" + +## reserved words +color yellow "\<(case|cond|true|if|false|nil|when|and|or|not|in|fn|do|end|catch|rescue|after|else|with)\>" +color yellow "def[a-z]*" + +## Constants +color brightblue "@[a-z]+" + +## Elixir atoms +color magenta ":[0-9a-z_]+" + +## Elixir Modules +color magenta "[A-Z][a-zA-Z0-9]*" + +## Elixir types +color red "[A-Z][A-Za-z]+\.t\(\)" + +## Some unique things we want to stand out +color brightyellow "\<(__CALLER__|__DIR__|__ENV__|__MODULE__|__STACKTRACE__)\>" +color brightyellow "\<(__add__|__aliases__|__build__|__block__|__deriving__|__info__|__protocol__|__struct__|__using__)\>" + +## sigils +color brightmagenta "~[a-z]\/([^\/])*\/[a-z]*" "~[a-z]\|([^\|])*\|[a-z]*" "~[a-z]\"([^\"])*\"[a-z]*" "~[a-z]\'([^\'])*\'[a-z]*" "~[a-z]\(([^\(\)])*\)[a-z]*" "~[a-z]\[([^\[\]])*\][a-z]*" "~[a-z]\{([^\{\}])*\}[a-z]*" "~[a-z]\<([^\<\>])*\>[a-z]*" + +## Strings, double-quoted +color green ""([^"]|(\\"))*"" + +## Expression substitution. These go inside double-quoted strings, +## "like #{this}". +color brightgreen "#\{[^}]*\}" + +## Strings, single-quoted +color green "'([^']|(\\'))*'" + +## Comments +color cyan "#.*$" "#$" +color brightcyan "##.*$" "##$" + +## "Here" docs +color green start="\"\"\"" end="\"\"\"" + +## Some common markers +color brightcyan "(XXX|TODO|FIXME|\?\?\?)" + +## Trailing spaces +color ,green "[[:space:]]+$"