nanorc.5 8.79 KB
Newer Older
Jordi Mallach's avatar
Jordi Mallach committed
1
.\" Hey, EMACS: -*- nroff -*-
2
3
.\" nanorc.5 is Copyright (C) 2003, 2004, 2005, 2006 by the Free
.\" Software Foundation, Inc.
Jordi Mallach's avatar
Jordi Mallach committed
4
.\"
5
6
7
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions.  There is NO
.\" warranty.
Jordi Mallach's avatar
Jordi Mallach committed
8
9
.\"
.\" $Id$
10
.TH NANORC 5 "version 1.3.11" "April 5, 2006"
Jordi Mallach's avatar
Jordi Mallach committed
11
12
13
14
15
16
17
18
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
nanorc \- GNU nano's rcfile
.SH DESCRIPTION
This manual page documents GNU \fBnano\fP's rcfile.
.PP
\fBnano\fP is a small, free and friendly editor which aims to replace
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
19
Pico, the default editor included in the non-free Pine package.  Rather
Jordi Mallach's avatar
Jordi Mallach committed
20
21
22
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
23
.PP
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
24
The \fInanorc\fP file contains the default settings for \fBnano\fP.
25
During startup, \fBnano\fP will first read its system-wide settings from
26
27
\fISYSCONFDIR/nanorc\fP, and then user-specific settings from
\fI~/.nanorc\fP.
Jordi Mallach's avatar
Jordi Mallach committed
28
29

.SH OPTIONS
30
31
32
33
34
The configuration file accepts a series of \fBset\fP and \fBunset\fP
commands, which can be used to configure nano on startup without using
the command line options.  Additionally, the \fBsyntax\fP, \fBcolor\fP,
and \fBicolor\fP keywords are used to define syntax highlighting rules
for different text patterns.  GNU nano will read one command per line.
Jordi Mallach's avatar
Jordi Mallach committed
35

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
36
37
Options in rcfiles take precedence over nano's defaults, and command
line options override rcfile settings.
Jordi Mallach's avatar
Jordi Mallach committed
38

Jordi Mallach's avatar
Jordi Mallach committed
39
40
Options are unset by default, except for options that take an argument.

41
42
Quotes inside string parameters don't have to be escaped with
backslashes.  The last double quote in the string will be treated as its
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
43
44
end.  For example, for the brackets option, "\fI"')>]}\fP" will match
\fI"\fP, \fI'\fP, \fI)\fP, \fI>\fP, \fI]\fP, and \fI}\fP.
45

Jordi Mallach's avatar
Jordi Mallach committed
46
47
48
The supported commands and arguments are:

.TP 3
49
.B set/unset autoindent
Jordi Mallach's avatar
Jordi Mallach committed
50
51
Use auto-indentation.
.TP
52
.B set/unset backup
53
Create backup files in \fIfilename~\fP.
Jordi Mallach's avatar
Jordi Mallach committed
54
.TP
55
.B set backupdir "\fIdirectory\fP"
56
57
Set the directory where \fBnano\fP puts unique backup files if file
backups are enabled.
58
.TP
59
.B set/unset backwards
60
61
Do backwards searches by default.
.TP
62
.B set brackets "\fIstring\fP"
63
Set the characters treated as closing brackets.  They cannot contain
64
blank characters.  Only closing punctuation, optionally followed by
65
66
closing brackets, can end sentences.  The default value is
"\fI"')>]}\fP".
67
.TP
68
.B set/unset casesensitive
69
70
Do case sensitive searches by default.
.TP
71
.B set/unset const
Jordi Mallach's avatar
Jordi Mallach committed
72
Constantly display the cursor position in the status bar.
Jordi Mallach's avatar
Jordi Mallach committed
73
.TP
74
.B set/unset cut
75
Use cut to end of line by default.
Jordi Mallach's avatar
Jordi Mallach committed
76
.TP
77
.B set fill \fIn\fP
78
79
80
Wrap lines at column number \fIn\fP.  If \fIn\fP is 0 or less, the
maximum line length will be the screen width less \fIn\fP columns.  The
default value is -8.
Jordi Mallach's avatar
Jordi Mallach committed
81
.TP
82
.B set/unset historylog
83
84
Enable \fI~/.nano_history\fP for saving and reading search/replace
strings.
85
.TP
86
87
.B set matchbrackets "\fIstring\fP"
Set the opening and closing brackets that can be found by bracket
88
89
90
searches.  They cannot contain blank characters.  The former set must
come before the latter set, and both must be in the same order.  The
default value is "\fI(<[{)>]}\fP".
91
.TP
92
.B set/unset morespace
93
94
Allow use of the blank line below the titlebar as extra editing space.
.TP
95
.B set/unset mouse
96
97
98
Enable mouse support, so that mouse clicks can be used to set the mark
and run shortcuts.
.TP
99
.B set/unset multibuffer
100
Allow inserting files into their own buffers.
Jordi Mallach's avatar
Jordi Mallach committed
101
.TP
102
.B set/unset noconvert
Jordi Mallach's avatar
Jordi Mallach committed
103
104
Don't convert files from DOS/Mac format.
.TP
105
.B set/unset nofollow
Jordi Mallach's avatar
Jordi Mallach committed
106
107
Don't follow symlinks when writing files.
.TP
108
.B set/unset nohelp
Jordi Mallach's avatar
Jordi Mallach committed
109
110
Don't display the help lists at the bottom of the screen.
.TP
111
112
113
.B set/unset nonewlines
Don't add newlines to the ends of files.
.TP
114
.B set/unset nowrap
Jordi Mallach's avatar
Jordi Mallach committed
115
116
Don't wrap text at all.
.TP
117
.B set operatingdir "\fIdirectory\fP"
Jordi Mallach's avatar
Jordi Mallach committed
118
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
119
120
121
subdirectories.  Also, the current directory is changed to here, so
files are inserted from this dir.  By default the operating directory
feature is turned off.
Jordi Mallach's avatar
Jordi Mallach committed
122
.TP
123
.B set/unset preserve
Jordi Mallach's avatar
Jordi Mallach committed
124
125
Preserve the XON and XOFF keys (^Q and ^S).
.TP
126
.B set punct "\fIstring\fP"
127
Set the characters treated as closing punctuation.  They cannot contain
128
blank characters.  Only closing punctuation, optionally followed by
129
closing brackets, can end sentences.  The default value is "\fI!.?\fP".
130
.TP
131
.B set/unset quickblank
132
133
134
Do quick statusbar blanking.  Statusbar messages will disappear after 1
keystroke instead of 25.
.TP
135
.B set quotestr "\fIstring\fP"
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
136
The email-quote string, used to justify email-quoted paragraphs.  This
137
is an extended regular expression if your system supports them,
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
138
otherwise a literal string.  The default value is
139
140
141
"\fI^([\ \\t]*[#:>\\|}])+\fP" if you have extended regular expression
support, or "\fI>\ \fP" otherwise.  Note that '\\t' stands for a literal
Tab character.
Jordi Mallach's avatar
Jordi Mallach committed
142
.TP
143
.B set/unset rebinddelete
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
144
145
146
147
Interpret the Delete key differently so that both Backspace and Delete
work properly.  You should only need to use this option if Backspace
acts like Delete on your system.
.TP
148
149
150
151
152
.B set/unset rebindkeypad
Interpret the numeric keypad keys so that they all work properly.  You
should only need to use this option if they don't, as mouse support
won't work properly with this option enabled.
.TP
153
.B set/unset regexp
154
Do extended regular expression searches by default.
155
.TP
156
.B set/unset smarthome
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
157
158
159
160
161
162
Make the Home key smarter.  When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards).  If the cursor is
already at that position, it will jump to the true beginning of the
line.
.TP
163
.B set/unset smooth
Jordi Mallach's avatar
Jordi Mallach committed
164
165
Use smooth scrolling by default.
.TP
166
.B set speller \fIspellprog\fP
Jordi Mallach's avatar
Jordi Mallach committed
167
168
Use spelling checker \fIspellprog\fP instead of the built-in one, which
calls \fIspell\fP.
Jordi Mallach's avatar
Jordi Mallach committed
169
.TP
170
.B set/unset suspend
171
Allow nano to be suspended.
Jordi Mallach's avatar
Jordi Mallach committed
172
.TP
173
.B set tabsize \fIn\fP
174
175
Use a tab size of \fIn\fP columns.  The value of \fIn\fP must be greater
than 0.  The default value is 8.  
Jordi Mallach's avatar
Jordi Mallach committed
176
.TP
177
.B set/unset tabstospaces
178
179
Convert typed tabs to spaces.
.TP
180
.B set/unset tempfile
Jordi Mallach's avatar
Jordi Mallach committed
181
182
Save automatically on exit, don't prompt.
.TP
183
.B set/unset view
Jordi Mallach's avatar
Jordi Mallach committed
184
185
Disallow file modification.
.TP
186
.B set whitespace "\fIstring\fP"
187
Set the two characters used to display the first characters of tabs and
188
spaces.  They must be single-column characters.
189
.TP
190
191
192
193
.B set/unset wordbounds
Detect word boundaries more accurately by treating punctuation
characters as part of a word.
.TP
194
.B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
195
196
Defines a syntax named \fIstr\fP which can be activated via the \fB-Y\fP
flag, or will be automatically activated if the current filename matches
197
198
199
the extended regular expression \fIfileregex\fP.  All following
\fBcolor\fP and \fBicolor\fP statements will apply to \fIsyntax\fP until
a new syntax is defined.
200
201
202
203
204

The \fInone\fP syntax is reserved; specifying it on the command line is
the same as not having a syntax at all.  The \fIdefault\fP syntax is
special: it takes no \fIfileregex\fP, and applies to files that don't
match any other syntax's \fIfileregex\fP.
205
.TP
206
.B color \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
207
For the currently defined syntax, display all expressions matching
208
209
210
211
212
213
214
215
the extended regular expression \fIregex\fP with foreground color
\fIfgcolor\fP and background color \fIbgcolor\fP, at least one of which
must be specified.  Legal colors for foreground and background color
are: white, black, red, blue, green, yellow, magenta, and cyan.  You may
use the prefix "bright" to force a stronger color highlight for the
foreground.  If your terminal supports transparency, not specifying a
\fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent
background.
216
.TP
217
218
219
.B icolor \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
Same as above, except that the expression matching is case insensitive.
.TP
220
.B color \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
221
222
223
Display expressions which start with the extended regular expression
\fIsr\fP and end with the extended regular expression \fIer\fP with
foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
224
225
226
227
at least one of which must be specified.  This allows syntax
highlighting to span multiple lines.  Note that all subsequent instances
of \fIsr\fP after an initial \fIsr\fP is found will be highlighted until
the first instance of \fIer\fP.
228
229
230
.TP
.B icolor \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
Same as above, except that the expression matching is case insensitive.
Jordi Mallach's avatar
Jordi Mallach committed
231

232
233
.SH FILES
.TP
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
234
.I SYSCONFDIR/nanorc
235
236
System-wide configuration file
.TP
237
.I ~/.nanorc
238
Per-user configuration file
Jordi Mallach's avatar
Jordi Mallach committed
239
240
241
242
243
.SH SEE ALSO
.PD 0
.TP
\fBnano\fP(1)
.PP
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
244
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
245
system)
Jordi Mallach's avatar
Jordi Mallach committed
246
.SH AUTHOR
247
248
249
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
\fITHANKS\fP for details).  This manual page was written by Jordi
Mallach <jordi@gnu.org>.