Skip to content

Commit 04c0cb1

Browse files
authored
Merge pull request #28 from davidhcefx/nanorc
enh(nanorc): Update colors and fix case sensitive
2 parents 835daca + 512a23a commit 04c0cb1

File tree

1 file changed

+62
-38
lines changed

1 file changed

+62
-38
lines changed

nanorc.nanorc

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,73 @@
33
syntax "Nanorc" "\.?nanorc$"
44
comment "#"
55

6-
## Possible errors and parameters
7-
icolor brightred "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
8-
## Colors
9-
icolor black " black"
10-
icolor red " red"
11-
icolor green " green"
12-
icolor yellow " yellow"
13-
icolor blue " blue"
14-
icolor magenta " magenta"
15-
icolor cyan " cyan"
16-
icolor white " white"
17-
icolor normal " normal"
18-
icolor brightblack " brightblack"
19-
icolor brightred " brightred"
20-
icolor brightgreen " brightgreen"
21-
icolor brightyellow " brightyellow"
22-
icolor brightblue " brightblue"
23-
icolor brightmagenta " brightmagenta"
24-
icolor brightcyan " brightcyan"
25-
icolor brightwhite " brightwhite"
26-
icolor normal " brightnormal"
27-
icolor ,black ",black "
28-
icolor ,red ",red "
29-
icolor ,green ",green "
30-
icolor ,yellow ",yellow "
31-
icolor ,blue ",blue "
32-
icolor ,magenta ",magenta "
33-
icolor ,cyan ",cyan "
34-
icolor ,white ",white "
35-
icolor ,normal ",normal"
36-
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
37-
icolor yellow "^[[:space:]]*(set|unset)[[:space:]]+(errorcolor|functioncolor|keycolor|numbercolor|selectedcolor|statuscolor|stripecolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
6+
## Possible invalid parameters
7+
color brightred "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
8+
9+
## Basic colors
10+
color red "\<red\>"
11+
color green "\<green\>"
12+
color blue "\<blue\>"
13+
color magenta "\<magenta\>"
14+
color yellow "\<yellow\>"
15+
color cyan "\<cyan\>"
16+
color white "\<white\>"
17+
color black "\<black\>"
18+
color normal "\<normal\>"
19+
## Light/bright colors
20+
color lightred "\<(light|bright)red\>"
21+
color lightgreen "\<(light|bright)green\>"
22+
color lightblue "\<(light|bright)blue\>"
23+
color lightmagenta "\<(light|bright)magenta\>"
24+
color lightyellow "\<(light|bright)yellow\>"
25+
color lightcyan "\<(light|bright)cyan\>"
26+
color lightwhite "\<(light|bright)white\>"
27+
color lightblack "\<(light|bright)black\>"
28+
color normal "\<(light|bright)normal\>"
29+
## 256 colors
30+
color pink "\<pink\>"
31+
color purple "\<purple\>"
32+
color mauve "\<mauve\>"
33+
color lagoon "\<lagoon\>"
34+
color mint "\<mint\>"
35+
color lime "\<lime\>"
36+
color peach "\<peach\>"
37+
color orange "\<orange\>"
38+
color latte "\<latte\>"
39+
color rosy "\<rosy\>"
40+
color beet "\<beet\>"
41+
color plum "\<plum\>"
42+
color sea "\<sea\>"
43+
color sky "\<sky\>"
44+
color slate "\<slate\>"
45+
color teal "\<teal\>"
46+
color sage "\<sage\>"
47+
color brown "\<brown\>"
48+
color ocher "\<ocher\>"
49+
color sand "\<sand\>"
50+
color tawny "\<tawny\>"
51+
color brick "\<brick\>"
52+
color crimson "\<crimson\>"
3853

3954
## Keywords
40-
icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|backupdir|boldtext|brackets|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|errorcolor|fill|functioncolor|guidestripe|historylog|jumpyscrolling|keycolor|linenumbers|locking|matchbrackets|morespace|mouse|multibuffer|noconvert|nohelp|nonewlines|nopauses|nowrap|numbercolor|operatingdir|positionlog|preserve|punct|quickblank|quotestr|rawsequences|rebinddelete|regexp|selectedcolor|showcursor|smarthome|smooth|softwrap|speller|statuscolor|stripecolor|suspend|tabsize|tabstospaces|tempfile|titlecolor|trimblanks|unix|view|whitespace|wordbounds|wordchars|zap)\>"
41-
icolor green "^[[:space:]]*(bind|set|unset|syntax|header|include|magic)\>"
55+
color green "^[[:space:]]*(set|unset|syntax|header|magic|formatter|linter|comment|tabgives|include|extendssyntax|bind|unbind)\>"
56+
color white "\<(bold|italic)\>" ","
57+
color magenta "^[[:space:]]*i?color\>" "\<(start|end)="
58+
#color yellow "^[[:space:]]*(set|unset)[[:space:]]+(errorcolor|functioncolor|keycolor|numbercolor|selectedcolor|statuscolor|stripecolor|titlecolor)[[:space:]]+(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
59+
60+
## Valid options
61+
## run: arr=($(man nanorc | grep " set " | awk '{print $2}')); echo "$(IFS='|'; echo "${arr[*]}")"
62+
color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|backupdir|boldtext|bookstyle|brackets|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|errorcolor|fill|functioncolor|guidestripe|historylog|indicator|jumpyscrolling|keycolor|linenumbers|locking|magic|matchbrackets|minibar|minicolor|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|numbercolor|operatingdir|positionlog|preserve|promptcolor|punct|quickblank|quotestr|rawsequences|rebinddelete|regexp|saveonexit|scrollercolor|selectedcolor|showcursor|smarthome|softwrap|speller|spotlightcolor|stateflags|statuscolor|stripecolor|tabsize|tabstospaces|titlecolor|trimblanks|unix|whitespace|wordbounds|wordchars|zap|zero)\>"
63+
4264
## Strings
43-
icolor white ""(\\.|[^"])*""
65+
#icolor white ""([^"]|\\.)*""
66+
color white "[[:blank:]](start=)?".+""
67+
4468
## Comments
45-
icolor brightblue "^[[:space:]]*#.*$"
46-
icolor cyan "^[[:space:]]*##.*$"
69+
color brightblue "^[[:space:]]*#.*$"
70+
color cyan "^[[:space:]]*##.*$"
4771
## Reminders
4872
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"
4973

5074
## Trailing whitespace
51-
icolor ,green "[[:space:]]+$"
75+
color ,green "[[:space:]]+$"

0 commit comments

Comments
 (0)