~ubuntu-branches/ubuntu/raring/nano/raring

« back to all changes in this revision

Viewing changes to doc/nanorc.sample

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach
  • Date: 2006-07-04 19:56:57 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20060704195657-0m31jgrthxdlvpgi
Tags: 1.3.12-1
* The "Quiebra Mítica" release.
* New upstream development release.
* debian/nanorc: sync with nanorc.sample, which now uses includes for
  highlight patterns.
* debian/patches/*.dpatch: removed, included in new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
## Sample initialization file for GNU nano.
2
2
##
3
3
## Please note that you must have configured nano with --enable-nanorc
4
 
## for this file to be read!  Also note that characters specially
5
 
## interpreted by the shell should not be escaped here.
 
4
## for this file to be read!  Also note that this file should not be in
 
5
## DOS or Mac format, and that characters specially interpreted by the
 
6
## shell should not be escaped here.
6
7
##
7
 
## To make sure a value is not enabled, use "unset <option>"
 
8
## To make sure a value is disabled, use "unset <option>".
8
9
##
9
10
## For the options that take parameters, the default value is given.
10
11
## Other options are unset by default.
11
12
##
12
13
## Quotes inside string parameters don't have to be escaped with
13
14
## backslashes.  The last double quote in the string will be treated as
14
 
## its end.  For example, for the brackets option, ""')>]}" will match
 
15
## its end.  For example, for the "brackets" option, ""')>]}" will match
15
16
## ", ', ), >, ], and }.
16
17
 
17
18
## Use auto-indentation.
26
27
## Do backwards searches by default.
27
28
# set backwards
28
29
 
29
 
## The characters treated as closing brackets.  They cannot contain
30
 
## blank characters.  Only closing punctuation, optionally followed by
31
 
## closing brackets, can end sentences.
 
30
## Use bold text instead of reverse video text.
 
31
# set boldtext
 
32
 
 
33
## The characters treated as closing brackets when justifying
 
34
## paragraphs.  They cannot contain blank characters.  Only closing
 
35
## punctuation, optionally followed by closing brackets, can end
 
36
## sentences.
32
37
##
33
38
# set brackets ""')>]}"
34
39
 
36
41
# set casesensitive
37
42
 
38
43
## Constantly display the cursor position in the statusbar.  Note that
39
 
## this cancels out "quickblank".
 
44
## this overrides "quickblank".
40
45
# set const
41
46
 
42
47
## Use cut to end of line by default.
60
65
## Use the blank line below the titlebar as extra editing space.
61
66
# set morespace
62
67
 
63
 
## Enable mouse support, so that mouse clicks can be used to set the
64
 
## mark and run shortcuts.
 
68
## Enable mouse support, if available for your system.  When enabled,
 
69
## mouse clicks can be used to place the cursor, set the mark (with a
 
70
## double click), and execute shortcuts.  The mouse will work in the X
 
71
## Window System, and on the console when gpm is running.
 
72
##
65
73
# set mouse
66
74
 
67
75
## Allow multiple file buffers (inserting a file will put it into a
87
95
 
88
96
## Set operating directory.  nano will not read or write files outside
89
97
## this directory and its subdirectories.  Also, the current directory
90
 
## is changed to here, so files are inserted from this dir.  A blank
 
98
## is changed to here, so any files are inserted from this dir.  A blank
91
99
## string means the operating directory feature is turned off.
92
100
##
93
101
# set operatingdir ""
95
103
## Preserve the XON and XOFF keys (^Q and ^S).
96
104
# set preserve
97
105
 
98
 
## The characters treated as closing punctuation.  They cannot contain
99
 
## blank characters.  Only closing punctuation, optionally followed by
100
 
## closing brackets, can end sentences.
 
106
## The characters treated as closing punctuation when justifying
 
107
## paragraphs.  They cannot contain blank characters.  Only closing
 
108
## punctuation, optionally followed by closing brackets, can end
 
109
## sentences.
101
110
##
102
111
# set punct "!.?"
103
112
 
104
113
## Do quick statusbar blanking.  Statusbar messages will disappear after
105
 
## 1 keystroke instead of 25.  Note that "const" cancels this out.
 
114
## 1 keystroke instead of 26.  Note that "const" overrides this.
106
115
##
107
116
# set quickblank
108
117
 
110
119
## This is an extended regular expression if your system supports them,
111
120
## otherwise a literal string.  Default:
112
121
# set quotestr "^([     ]*[#:>\|}])+"
113
 
## if you have regexps, otherwise:
 
122
## if you have extended regular expression support, otherwise:
114
123
# set quotestr "> "
115
124
 
116
125
## Fix Backspace/Delete confusion problem.
153
162
# set view
154
163
 
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 "  "
159
168
 
160
169
## Detect word boundaries more accurately by treating punctuation
161
170
## characters as part of a word.
162
171
# set wordbounds
163
172
 
 
173
 
164
174
## Color setup
165
175
##
166
176
## Format:
167
177
##
168
178
## syntax "short description" ["filename regex" ...]
169
179
##
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.
174
184
##
175
185
## color foreground,background "regex" ["regex"...]
176
186
## or
177
187
## icolor foreground,background "regex" ["regex"...]
178
188
##
179
 
## ("color" will do case sensitive matches, while "icolor" will do case
180
 
## insensitive matches.)
181
 
##
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.
185
 
##
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.
 
191
##
 
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.
 
195
##
 
196
## To use multi-line regexes, use the start="regex" end="regex"
 
197
## [start="regex" end="regex"...] format.
187
198
##
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.
191
202
##
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]?'"
202
 
##
203
 
## GCC builtins
204
 
##
205
 
# color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
206
 
##
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
209
 
## are read in.
210
 
##
211
 
# color brightyellow "<[^=      ]*>" ""(\\.|[^\"])*""
212
 
##
213
 
## This string is VERY resource intensive!
214
 
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
215
 
##
216
 
## And we want to have some nice comment highlighting too
217
 
# color brightblue "//.*"
218
 
# color brightblue start="/\*" end="\*/"
219
 
 
220
 
## Here is a short example for HTML
221
 
# syntax "HTML" "\.html$"
222
 
# color blue start="<" end=">"
223
 
# color red "&[^;[[:space:]]]*;"
224
 
 
225
 
## Here is a short example for TeX files
226
 
# syntax "TeX" "\.tex$"
227
 
# icolor green "\\.|\\[A-Z]*"
228
 
# color magenta "[{}]"
229
 
# color blue "%.*"
230
 
 
231
 
## Here is an example for quoted emails (under e.g. mutt)
232
 
# syntax "mutt"
233
 
# color green "^>.*"
234
 
 
235
 
## Here is an example for groff
236
 
##
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]"
247
 
## \n
248
 
# color cyan "(\\|\\\\)n."
249
 
# color cyan "(\\|\\\\)n\(.."
250
 
# color cyan start="(\\|\\\\)n\[" end="]"
251
 
## Requests
252
 
# color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
253
 
## Comments
254
 
# color yellow "^\.\\\".*$"
255
 
## Strings
256
 
# color green "(\\|\\\\)\*."
257
 
# color green "(\\|\\\\)\*\(.."
258
 
# color green start="(\\|\\\\)\*\[" end="]"
259
 
## Characters
260
 
# color brightred "\\\(.."
261
 
# color brightred start="\\\[" end="]"
262
 
## Macro arguments
263
 
# color brightcyan "\\\\\$[1-9]"
264
 
 
265
 
## Here is an example for perl
266
 
##
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=";"
274
 
# color green "#.*"
275
 
# color yellow start="<< 'STOP'" end="STOP"
276
 
 
277
 
## Here is an example for Java source
278
 
##
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)\>"
285
 
# color blue "//.*"
286
 
# color blue start="/\*" end="\*/"
287
 
# color brightblue start="/\*\*" end="\*/"
288
 
# color brightgreen,green "[[:space:]]+$"
289
 
 
290
 
## Here is an example for patch files
291
 
##
292
 
# syntax "patch" "\.(patch|diff)$"
293
 
# color brightgreen "^\+.*"
294
 
# color green "^\+\+\+.*"
295
 
# color brightblue "^ .*"
296
 
# color brightred "^-.*"
297
 
# color red "^---.*"
298
 
# color brightyellow "^@@.*"
299
 
# color magenta "^diff.*"
300
 
 
301
 
## Here is an example for manpages
302
 
##
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)"
310
 
 
311
 
## Here is an example for assembler
312
 
##
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="\*/"
326
 
 
327
 
## Here is an example for Bourne shell scripts
328
 
##
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 ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
339
 
 
340
 
## Here is an example for your .nanorc
341
 
##
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)\>"
348
 
## colors
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)="
351
 
## strings
352
 
# icolor white "\"(\\.|[^\"])*\""
353
 
## comments
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:
 
206
##
 
207
## include "/path/to/syntax_file.nanorc"
 
208
##
 
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.
 
213
##
 
214
## All regexes should be extended regular expressions.
 
215
 
 
216
 
 
217
## Nanorc files
 
218
# include "/usr/local/share/nano/nanorc.nanorc"
 
219
 
 
220
## C/C++
 
221
# include "/usr/local/share/nano/c.nanorc"
 
222
 
 
223
## HTML
 
224
# include "/usr/local/share/nano/html.nanorc"
 
225
 
 
226
## TeX
 
227
# include "/usr/local/share/nano/tex.nanorc"
 
228
 
 
229
## Quoted emails (under e.g. mutt)
 
230
# include "/usr/local/share/nano/mutt.nanorc"
 
231
 
 
232
## Patch files
 
233
# include "/usr/local/share/nano/patch.nanorc"
 
234
 
 
235
## Manpages
 
236
# include "/usr/local/share/nano/man.nanorc"
 
237
 
 
238
## Groff
 
239
# include "/usr/local/share/nano/groff.nanorc"
 
240
 
 
241
## Perl
 
242
# include "/usr/local/share/nano/perl.nanorc"
 
243
 
 
244
## Python
 
245
# include "/usr/local/share/nano/python.nanorc"
 
246
 
 
247
## Ruby
 
248
# include "/usr/local/share/nano/ruby.nanorc"
 
249
 
 
250
## Java
 
251
# include "/usr/local/share/nano/java.nanorc"
 
252
 
 
253
## Assembler
 
254
# include "/usr/local/share/nano/asm.nanorc"
 
255
 
 
256
## Bourne shell scripts
 
257
# include "/usr/local/share/nano/sh.nanorc"