1
0
mirror of https://github.com/scopatz/nanorc synced 2024-11-23 17:15:40 +01:00

Merge branch 'v2.9' into patch-1

This commit is contained in:
Ondřej Ešler 2019-07-23 16:46:58 +02:00 committed by GitHub
commit 4c4cc5d701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 276 additions and 18 deletions

View File

@ -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)\>"

50
elixir.nanorc Normal file
View File

@ -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:]]+$"

39
fsharp.nanorc Normal file
View File

@ -0,0 +1,39 @@
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|Option|Choice|Map|list|seq|array|option|choice|ref|in|out)\>"
color brightgreen "<+[A-Za-z0-9'^]+ *((:) +[A-Za-z0-9'^.]+)?>"
# Attributes
color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]"
# 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 magenta "\\([btnfr]|'|\"|\\)"
color magenta "\\u[A-Fa-f0-9]{4}"
# String
color yellow ""(\\.|[^"])*""
# Comments
color brightblack "(^|[[:space:]])//.*"
color brightblack start="/\*" end="\*/"
color brightblack start="\(\*" end="\*\)"
color brightwhite,cyan "TODO:?"
color ,green "[[:space:]]+$"
color ,red " + +| + +"
color red "#if .+"
color red "#endif"
color white start="``" end="``"

View File

@ -8,10 +8,7 @@ fi
_fetch_sources(){
wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/v2.9.zip
if [ ! -d ~/.nano/ ]
then
mkdir ~/.nano/
fi
mkdir -p ~/.nano/
cd ~/.nano/ || exit
unzip -o "/tmp/nanorc.zip"
@ -21,10 +18,7 @@ _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
@ -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

View File

@ -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))?\>"

View File

@ -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|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+\(\)"
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"

172
x11basic.nanorc Normal file
View File

@ -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)"