155
164
## The two single-column characters used to display the first characters
156
## of tabs and spaces. 187 decimal (00BB hexadecimal) and 183 decimal
157
## (00B7 hexadecimal) seem to be good values for these.
165
## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode) and 183 in
166
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these.
158
167
# set whitespace " "
160
169
## Detect word boundaries more accurately by treating punctuation
161
170
## characters as part of a word.
168
178
## syntax "short description" ["filename regex" ...]
170
## (The "none" syntax is reserved; specifying it on the command line is
180
## The "none" syntax is reserved; specifying it on the command line is
171
181
## the same as not having a syntax at all. The "default" syntax is
172
182
## special: it takes no filename regexes, and applies to files that
173
## don't match any other syntax's filename regexes.)
183
## don't match any other syntax's filename regexes.
175
185
## color foreground,background "regex" ["regex"...]
177
187
## icolor foreground,background "regex" ["regex"...]
179
## ("color" will do case sensitive matches, while "icolor" will do case
180
## insensitive matches.)
182
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
183
## You may use the prefix "bright" to mean a stronger color highlight
184
## for the foreground.
186
## To use multi-line regexes, use the start="regex" end="regex" format.
189
## "color" will do case sensitive matches, while "icolor" will do case
190
## insensitive matches.
192
## Valid colors: white, black, red, blue, green, yellow, magenta, cyan.
193
## For foreground colors, you may use the prefix "bright" to get a
194
## stronger highlight.
196
## To use multi-line regexes, use the start="regex" end="regex"
197
## [start="regex" end="regex"...] format.
188
199
## If your system supports transparency, not specifying a background
189
200
## color will use a transparent color. If you don't want this, be sure
190
201
## to set the background color to black or white.
192
# syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
193
# color brightred "\<[A-Z_][A-Z_0-9]+\>"
194
# color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>"
195
# color green "\<(u_?)?int(8|16|32|64|ptr)_t\>"
196
# color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
197
# color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
198
# color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
199
# color magenta "\<(goto|continue|break|return)\>"
200
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
201
# color brightmagenta "'([^"'\]|(\\["'abfnrtv\\]))'" "'\\(([0-7][0-7]?)|([0-3][0-7][0-7]))'" "'\\x[0-9A-Fa-f][0-9A-Fa-f]?'"
205
# color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
207
## You will in general want your comments and strings to come last,
208
## because syntax highlighting rules will be applied in the order they
211
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
213
## This string is VERY resource intensive!
214
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
216
## And we want to have some nice comment highlighting too
217
# color brightblue "//.*"
218
# color brightblue start="/\*" end="\*/"
220
## Here is a short example for HTML
221
# syntax "HTML" "\.html$"
222
# color blue start="<" end=">"
223
# color red "&[^;[[:space:]]]*;"
225
## Here is a short example for TeX files
226
# syntax "TeX" "\.tex$"
227
# icolor green "\\.|\\[A-Z]*"
228
# color magenta "[{}]"
231
## Here is an example for quoted emails (under e.g. mutt)
235
## Here is an example for groff
237
# syntax "groff" "\.m[ems]$" "\.tmac$" "^tmac." ".rof"
238
## The argument of .nr or .ds
239
# color cyan "^\.ds [^[[:space:]]]*"
240
# color cyan "^\.nr [^[[:space:]]]*"
241
## Single character escapes
242
# color brightmagenta "\\."
243
## Highlight the argument of \f or \s in the same color
244
# color brightmagenta "\\f."
245
# color brightmagenta "\\f\(.."
246
# color brightmagenta "\\s(\+|\-)?[0-9]"
248
# color cyan "(\\|\\\\)n."
249
# color cyan "(\\|\\\\)n\(.."
250
# color cyan start="(\\|\\\\)n\[" end="]"
252
# color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
254
# color yellow "^\.\\\".*$"
256
# color green "(\\|\\\\)\*."
257
# color green "(\\|\\\\)\*\(.."
258
# color green start="(\\|\\\\)\*\[" end="]"
260
# color brightred "\\\(.."
261
# color brightred start="\\\[" end="]"
263
# color brightcyan "\\\\\$[1-9]"
265
## Here is an example for perl
267
# syntax "perl" "\.p[lm]$"
268
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
269
# color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
270
# color cyan start="[$@%]" end="( |\\W|-)"
271
# color yellow "".*"|qq\|.*\|"
272
# color white "[sm]/.*/"
273
# color white start="(^use| = new)" end=";"
275
# color yellow start="<< 'STOP'" end="STOP"
277
## Here is an example for Java source
279
# syntax "Java source" "\.java$"
280
# color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
281
# color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
282
# color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
283
# color red ""[^\"]*""
284
# color yellow "\<(true|false|null)\>"
286
# color blue start="/\*" end="\*/"
287
# color brightblue start="/\*\*" end="\*/"
288
# color brightgreen,green "[[:space:]]+$"
290
## Here is an example for patch files
292
# syntax "patch" "\.(patch|diff)$"
293
# color brightgreen "^\+.*"
294
# color green "^\+\+\+.*"
295
# color brightblue "^ .*"
296
# color brightred "^-.*"
298
# color brightyellow "^@@.*"
299
# color magenta "^diff.*"
301
## Here is an example for manpages
303
# syntax "manpage" "\.[1-9]x?$"
304
# color green "\.(S|T)H.*$"
305
# color brightgreen "\.(S|T)H" "\.TP"
306
# color brightred "\.(BR?|I[PR]?).*$"
307
# color brightblue "\.(BR?|I[PR]?|PP)"
308
# color brightwhite "\\f[BIPR]"
309
# color yellow "\.(br|DS|RS|RE|PD)"
311
## Here is an example for assembler
313
# syntax "asm-file" "\.(S|s|asm)$"
314
# color red "\<[A-Z_]{2,}\>"
315
# color brightgreen "\.(data|subsection|text)"
316
# color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
317
# color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
318
# icolor brightred "^[[:space:]]*[._A-Z0-9]*:"
319
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
320
## Highlight strings (note: VERY resource intensive)
321
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
322
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
323
## Highlight comments
324
# color brightblue "//.*"
325
# color brightblue start="/\*" end="\*/"
327
## Here is an example for Bourne shell scripts
329
# syntax "shellscript" "\.sh$"
330
# icolor brightgreen "^[_A-Z0-9]+\(\)"
331
# color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
332
# color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
333
# color green "-(L|d|e|f|g|r|u|w|x)\>"
334
# color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
335
# color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
336
# icolor brightred "\$\{?[_A-Z0-9]+\}?"
337
# color yellow "#.*$"
338
# color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
340
## Here is an example for your .nanorc
342
# syntax "nanorc" "(\.|/|)nanorc$"
343
## highlight possible errors and parameters
344
# icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
345
## set, unset and syntax
346
# icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct|quickblank)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace|wordbounds)\>"
347
# icolor green "^[[:space:]]*(set|unset|syntax)\>"
349
# icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
350
# icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
352
# icolor white "\"(\\.|[^\"])*\""
354
# icolor blue "^[[:space:]]*#.*$"
203
## If you wish, you may put your syntaxes in separate files. You can
204
## make use of such files (which can only include "syntax", "color", and
205
## "icolor" commands) as follows:
207
## include "/path/to/syntax_file.nanorc"
209
## Unless otherwise noted, the name of the syntax file (without the
210
## ".nanorc" extension) should be the same as the "short description"
211
## name inside that file. These names are kept fairly short to make
212
## them easier to remember and faster to type using nano's -Y option.
214
## All regexes should be extended regular expressions.
218
# include "/usr/local/share/nano/nanorc.nanorc"
221
# include "/usr/local/share/nano/c.nanorc"
224
# include "/usr/local/share/nano/html.nanorc"
227
# include "/usr/local/share/nano/tex.nanorc"
229
## Quoted emails (under e.g. mutt)
230
# include "/usr/local/share/nano/mutt.nanorc"
233
# include "/usr/local/share/nano/patch.nanorc"
236
# include "/usr/local/share/nano/man.nanorc"
239
# include "/usr/local/share/nano/groff.nanorc"
242
# include "/usr/local/share/nano/perl.nanorc"
245
# include "/usr/local/share/nano/python.nanorc"
248
# include "/usr/local/share/nano/ruby.nanorc"
251
# include "/usr/local/share/nano/java.nanorc"
254
# include "/usr/local/share/nano/asm.nanorc"
256
## Bourne shell scripts
257
# include "/usr/local/share/nano/sh.nanorc"