nanorc.5 26 KB
Newer Older
1
.\" Copyright (C) 2003-2011, 2013-2017 Free Software Foundation, Inc.
Jordi Mallach's avatar
Jordi Mallach committed
2
.\"
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.\" This document is dual-licensed.  You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\"   Foundation, version 3 or (at your option) any later version.  You
.\"   should have received a copy of the GNU General Public License
.\"   along with this program.  If not, see
.\"   <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\"   Software Foundation, version 1.2 or (at your option) any later
.\"   version, with no Invariant Sections, no Front-Cover Texts, and no
.\"   Back-Cover Texts.  You should have received a copy of the GNU Free
.\"   Documentation License along with this program.  If not, see
.\"   <http://www.gnu.org/licenses/>.
Jordi Mallach's avatar
Jordi Mallach committed
18
.\"
19
.TH NANORC 5 "version 2.8.6" "July 2017"
Jordi Mallach's avatar
Jordi Mallach committed
20
.\" Please adjust this date whenever revising the manpage.
21

Jordi Mallach's avatar
Jordi Mallach committed
22
.SH NAME
23
24
nanorc \- GNU nano's configuration file

Jordi Mallach's avatar
Jordi Mallach committed
25
.SH DESCRIPTION
26
27
28
The \fInanorc\fP file contains the default settings for \fBnano\fP, a
small and friendly editor.  The file should be in Unix format, not in
DOS or Mac format.  During startup, \fBnano\fP will first read the
29
30
system-wide settings, from \fB/etc/nanorc\fP (the exact path might be
different), and then the user-specific settings, from \fB~/.nanorc\fP.
Jordi Mallach's avatar
Jordi Mallach committed
31
32

.SH OPTIONS
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
35
36
37
command-line options.  Additionally, there are some commands to define
syntax highlighting and to rebind keys -- see the two separate sections
on those.  \fBnano\fP reads one command per line.
38
.PP
39
Options in \fInanorc\fP files take precedence over nano's defaults, and
40
41
42
43
44
45
46
47
command-line options override \fInanorc\fP settings.  Also, options that
do not take an argument are unset by default.  So using the \fBunset\fR
command is only needed when wanting to override a setting of the system's
\fInanorc\fR file in your own \fB~/.nanorc\fR.  Options that take an
argument cannot be unset.
.PP
Below, the \fIstring\fR parameters need to be enclosed in double quotes.
Quotes inside these string parameters don't have to be escaped with
48
backslashes.  The last double quote in the string will be treated as its
49
50
end.  For example, for the \fBbrackets\fP option, "\fB"')>]}\fP" will
match \fB"\fP, \fB'\fP, \fB)\fP, \fB>\fP, \fB]\fP, and \fB}\fP.
51
.PP
Jordi Mallach's avatar
Jordi Mallach committed
52
53
54
The supported commands and arguments are:

.TP 3
55
.B set allow_insecure_backup
56
When backing up files, allow the backup to succeed even if its permissions
57
can't be (re)set due to special OS considerations.  You should
58
59
NOT enable this option unless you are sure you need it.
.TP
60
61
62
63
.B set atblanks
When soft line wrapping is enabled, make it wrap lines at blank characters
(tabs and spaces) instead of always at the edge of the screen.
.TP
64
.B set autoindent
Jordi Mallach's avatar
Jordi Mallach committed
65
66
Use auto-indentation.
.TP
67
.B set backup
68
69
When saving a file, create a backup file by adding a tilde (\fB~\fP) to
the file's name.
Jordi Mallach's avatar
Jordi Mallach committed
70
.TP
71
.B set backupdir "\fIdirectory\fP"
72
Make and keep not just one backup file, but make and keep a uniquely
73
numbered one every time a file is saved -- when backups are enabled
74
75
with \fBset backup\fR or \fB\-\-backup\fR or \fB\-B\fR.
The uniquely numbered files are stored in the specified \fIdirectory\fR.
76
.TP
77
.B set backwards
78
79
Do backwards searches by default.
.TP
80
.B set boldtext
81
Use bold instead of reverse video for the title bar, status bar, key combos,
82
83
84
function tags, line numbers, and selected text.  This can be overridden by
setting the options \fBtitlecolor\fP, \fBstatuscolor\fP, \fBkeycolor\fP,
\fBfunctioncolor\fP, \fBnumbercolor\fP, and \fBselectedcolor\fP.
85
.TP
86
.B set brackets "\fIstring\fP"
87
Set the characters treated as closing brackets when justifying
88
89
90
paragraphs.  This may not include blank characters.  Only closing
punctuation (see \fBpunct\fP), optionally followed by the specified
closing brackets, can end sentences.  The default value is "\fB"')>]}\fP".
91
.TP
92
.B set casesensitive
93
Do case-sensitive searches by default.
94
.TP
95
.B set constantshow
Jordi Mallach's avatar
Jordi Mallach committed
96
Constantly display the cursor position in the status bar.
97
(The old form of this option, '\fBset const\fR', is deprecated.)
98
This overrides the option \fBquickblank\fR.
Jordi Mallach's avatar
Jordi Mallach committed
99
.TP
100
101
102
.B set cutfromcursor
Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line.
(The old form of this option, '\fBset cut\fR', is deprecated.)
Jordi Mallach's avatar
Jordi Mallach committed
103
.TP
104
105
106
.B set fill \fInumber\fR
Hard-wrap lines at column number \fInumber\fR.  If \fInumber\fR is 0 or less,
the maximum line length will be the screen width less \fInumber\fP columns.
107
108
The default value is \fB\-8\fR.  This option conflicts with
\fBnowrap\fR -- the last one given takes effect.
Jordi Mallach's avatar
Jordi Mallach committed
109
.TP
110
111
112
113
114
.B set functioncolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the function descriptions
in the two help lines at the bottom of the screen.
See \fBset titlecolor\fR for more details.
.TP
115
.B set historylog
116
Enable the use of \fB~/.nano/search_history\fP for saving and reading
117
search/replace strings.
118
.TP
119
.B set justifytrim
120
When justifying text, trailing whitespace will automatically be removed.
121
.TP
122
123
124
125
126
.B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the shortcut key combos
in the two help lines at the bottom of the screen.
See \fBset titlecolor\fR for more details.
.TP
127
128
129
.B set linenumbers
Display line numbers to the left of the text area.
.TP
130
.B set locking
131
132
Enable vim-style lock-files for when editing files.
.TP
133
134
.B set matchbrackets "\fIstring\fP"
Set the opening and closing brackets that can be found by bracket
135
136
137
searches.  This may not include blank characters.  The opening set must
come before the closing set, and the two sets must be in the same order.
The default value is "\fB(<[{)>]}\fP".
138
.TP
139
.B set morespace
140
Use the blank line below the title bar as extra editing space.
141
.TP
142
.B set mouse
143
144
145
Enable mouse support, if available for your system.  When enabled, mouse
clicks can be used to place the cursor, set the mark (with a double
click), and execute shortcuts.  The mouse will work in the X Window
146
System, and on the console when gpm is running.  Text can still be
147
selected through dragging by holding down the Shift key.
148
.TP
149
.B set multibuffer
150
When reading in a file with ^R, insert it into a new buffer by default.
Jordi Mallach's avatar
Jordi Mallach committed
151
.TP
152
.B set noconvert
Jordi Mallach's avatar
Jordi Mallach committed
153
154
Don't convert files from DOS/Mac format.
.TP
155
.B set nohelp
156
Don't display the two help lines at the bottom of the screen.
Jordi Mallach's avatar
Jordi Mallach committed
157
.TP
158
.B set nonewlines
159
Don't automatically add a newline to the ends of files.
160
.TP
161
162
163
164
.B set nopauses
Don't pause between warnings at startup.  This means that only
the last one will be visible (when there are multiple ones).
.TP
165
.B set nowrap
166
167
Don't hard-wrap text at all.  This option conflicts with
\fBfill\fR -- the last one given takes effect.
Jordi Mallach's avatar
Jordi Mallach committed
168
.TP
169
170
171
172
.B set numbercolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for line numbers.
See \fBset titlecolor\fR for more details.
.TP
173
.B set operatingdir "\fIdirectory\fP"
Jordi Mallach's avatar
Jordi Mallach committed
174
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
175
subdirectories.  Also, the current directory is changed to here, so
176
files are inserted from this directory.  By default, the operating
177
directory feature is turned off.
Jordi Mallach's avatar
Jordi Mallach committed
178
.TP
179
.B set positionlog
180
Save the cursor position of files between editing sessions.
181
The cursor position is remembered for the 200 most-recently edited files.
182
(The old form of this option, '\fBset poslog\fR', is deprecated.)
183
.TP
184
.B set preserve
Jordi Mallach's avatar
Jordi Mallach committed
185
186
Preserve the XON and XOFF keys (^Q and ^S).
.TP
187
.B set punct "\fIstring\fP"
188
Set the characters treated as closing punctuation when justifying
189
190
191
paragraphs.  This may not include blank characters.  Only the
specfified closing punctuation, optionally followed by closing brackets
(see \fBbrackets\fP), can end sentences.  The default value is "\fB!.?\fP".
192
.TP
193
.B set quickblank
194
Do quick status-bar blanking: status-bar messages will disappear after 1
195
keystroke instead of 25.  The option \fBconstantshow\fR overrides this.
196
.TP
197
.B set quiet
198
\fBnano\fP will not report errors in the \fInanorc\fP file nor ask them
199
to be acknowledged by pressing Enter at startup.  If this is used, it
200
201
should be placed at the top of the file to be fully effective.
.TP
202
.B set quotestr "\fIstring\fP"
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
203
The email-quote string, used to justify email-quoted paragraphs.  This
204
is an extended regular expression if your system supports them,
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
205
otherwise a literal string.  The default value is
206
207
"\fB^([\ \\t]*[#:>\\|}])+\fP" if you have extended regular expression
support, and "\fB>\ \fP" otherwise.  Note that '\\t' stands for a literal
208
Tab character.
Jordi Mallach's avatar
Jordi Mallach committed
209
.TP
210
.B set rebinddelete
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
211
212
213
214
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
215
.B set rebindkeypad
216
217
218
219
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
220
.B set regexp
221
Do extended regular expression searches by default.
222
.TP
223
224
225
226
.B set selectedcolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for selected text.
See \fBset titlecolor\fR for more details.
.TP
227
228
229
230
.B set showcursor
Put the cursor on the highlighted item in the file browser, to aid
braille users.
.TP
231
.B set smarthome
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
232
233
234
235
236
237
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
238
.B set smooth
Jordi Mallach's avatar
Jordi Mallach committed
239
240
Use smooth scrolling by default.
.TP
241
.B set softwrap
242
Enable soft line wrapping for easier viewing of very long lines.
243
.TP
244
.B set speller "\fIspellprog\fP"
Jordi Mallach's avatar
Jordi Mallach committed
245
246
Use spelling checker \fIspellprog\fP instead of the built-in one, which
calls \fIspell\fP.
Jordi Mallach's avatar
Jordi Mallach committed
247
.TP
248
.B set statuscolor \fIfgcolor\fR,\fIbgcolor\fR
249
Specify the color combination to use for the status bar.
250
251
See \fBset titlecolor\fR for more details.
.TP
252
.B set suspend
253
Allow \fBnano\fP to be suspended.
Jordi Mallach's avatar
Jordi Mallach committed
254
.TP
255
256
257
.B set tabsize \fInumber\fR
Use a tab size of \fInumber\fR columns.  The value of \fInumber\fP must be
greater than 0.  The default value is \fB8\fR.
Jordi Mallach's avatar
Jordi Mallach committed
258
.TP
259
.B set tabstospaces
260
261
Convert typed tabs to spaces.
.TP
262
.B set tempfile
Jordi Mallach's avatar
Jordi Mallach committed
263
264
Save automatically on exit, don't prompt.
.TP
265
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
266
Specify the color combination to use for the title bar.
267
268
269
Valid names for the foreground and background colors are:
.BR white ", " black ", " blue ", " green ", " red ", " cyan ", " yellow ",  and " magenta .
The name of the foreground color may be prefixed with \fBbright\fR.
270
271
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
.TP
272
273
274
275
276
.B set unix
Save a file by default in Unix format.  This overrides nano's
default behavior of saving a file in the format that it had.
(This option has no effect when you also use \fBset noconvert\fR.)
.TP
277
.B set view
Jordi Mallach's avatar
Jordi Mallach committed
278
279
Disallow file modification.
.TP
280
.B set whitespace "\fIstring\fP"
281
Set the two characters used to indicate the presence of tabs and
282
spaces.  They must be single-column characters.  The default pair
283
for a UTF-8 locale is "\fB\[Fc]\[md]\fR", and for other locales "\fB>.\fR".
284
.TP
285
.B set wordbounds
286
Detect word boundaries differently by treating punctuation
287
characters as parts of words.
288
289
290
291
292
.TP
.B set wordchars \fIstring\fP
Specify which other characters (besides the normal alphanumeric ones)
should be considered as parts of words.  This overrides the option
\fBwordbounds\fR.
293
294
295

.SH SYNTAX HIGHLIGHTING
Coloring the different syntactic elements of a file
296
297
298
299
300
301
is done via regular expressions (see the \fBcolor\fR command below).
This is inherently imperfect, because regular expressions are not
powerful enough to fully parse a file.  Nevertheless, regular
expressions can do a lot and are easy to make, so they are a
good fit for a small editor like \fBnano\fR.
.sp
302
For each kind of file a separate syntax can be defined
303
via the following commands:
304
.TP
305
.BR syntax " ""\fIname\fR"" [""\fIfileregex\fR"" ...]"
306
307
308
309
Start the definition of a syntax with this \fIname\fR.
All subsequent \fBcolor\fR and other such commands
will be added to this syntax, until a new \fBsyntax\fR
command is encountered.
310

311
312
313
314
315
316
317
318
319
320
When \fBnano\fR is run, this syntax will be automatically
activated if the current filename matches the extended regular
expression \fIfileregex\fR.  Or the syntax can be explicitly
activated by using the \fB-Y\fR or \fB\-\-syntax\fR
command-line option followed by the \fIname\fR.

The syntax "\fBdefault\fP" is special: it takes no \fIfileregex\fR,
and applies to files that don't match any syntax's regexes.
The syntax "\fBnone\fP" is reserved; specifying it on the command line
is the same as not having a syntax at all.
321
.TP
322
323
324
325
326
327
328
329
330
331
332
333
334
.BR header " ""\fIregex\fR"" " ...
If from all defined syntaxes no \fIfileregex\fR matched, then compare
this \fIregex\fR (or regexes) against the first line of the current file,
to determine whether this syntax should be used for it.
.TP
.BR magic " ""\fIregex\fR"" " ...
If no \fIfileregex\fR matched and no \fBheader\fR regex matched
either, then compare this \fIregex\fR (or regexes) against the
result of querying the \fBmagic\fP database about the current
file, to determine whether this syntax should be used for it.
(This functionality only works when \fBlibmagic\fP is installed on the
system and will be silently ignored otherwise.)
.TP
335
.BI linter " program " \fR[ "arg " \fR...]
336
337
Use the given \fIprogram\fR to run a syntax check on the current file.
(This overrides the speller function.)
338
.TP
339
.BI formatter " program " \fR[ "arg " \fR...]
340
341
342
Use the given \fIprogram\fR to automatically reformat text --
useful in a programming language like Go.
(This overrides the speller and linter functions.)
343
.TP
344
.BR comment " ""\fIstring\fR"""
345
346
347
Use the given string for commenting and uncommenting lines.
If the string contains a vertical bar or pipe character (\fB|\fR),
this designates bracket-style comments; for example, "\fB/*|*/\fR" for
348
349
CSS files.  The characters before the pipe are prepended to the line and the
characters after the pipe are appended at the end of the line.  If no pipe
350
351
352
character is present, the full string is prepended; for example, "\fB#\fR"
for Python files.  If empty double quotes are specified, the comment/uncomment
function is disabled; for example, "" for JSON.
353
The default value is "\fB#\fP".
354
.TP
355
.B color \fIfgcolor\fR,\fIbgcolor\fR """\fIregex\fR""" ...
356
Display all pieces of text that match
357
358
the extended regular expression \fIregex\fP with foreground color
\fIfgcolor\fP and background color \fIbgcolor\fP, at least one of which
359
must be specified.  Valid colors for foreground and background
360
are: white, black, red, blue, green, yellow, magenta, and cyan.  You may
361
use the prefix "bright" to get a stronger color highlight for the
362
363
364
foreground.  If your terminal supports transparency, not specifying a
\fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent
background.
365
.TP
366
.B icolor \fIfgcolor\fR,\fIbgcolor\fR """\fIregex\fR""" ...
367
Same as above, except that the matching is case insensitive.
368
.TP
369
.BR color " \fIfgcolor\fR,\fIbgcolor\fR " start= """\fIfromrx\fR"" " end= """\fItorx\fR""
370
Display all pieces of text whose start matches extended regular expression
371
\fIfromrx\fP and whose end matches extended regular expression \fItorx\fP with
372
foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
373
at least one of which must be specified.  This means that, after an
374
375
initial instance of \fIfromrx\fP, all text until the first instance of
\fItorx\fP will be colored.  This allows syntax highlighting to span
376
multiple lines.
377
.TP
378
379
.BR icolor " \fIfgcolor\fR,\fIbgcolor\fR " start= """\fIfromrx\fR"" " end= """\fItorx\fR""
Same as above, except that the matching is case insensitive.
380
.TP
381
.BR include " ""\fIsyntaxfile\fR"""
382
Read in self-contained color syntaxes from \fIsyntaxfile\fP.  Note that
383
\fIsyntaxfile\fP may contain only the above commands, from \fBsyntax\fP
384
to \fBicolor\fP.
385
.TP
386
387
388
.BI extendsyntax " name command " \fR[ "arg " \fR...]
Extend the syntax previously defined as \fIname\fR with another
\fIcommand\fR.  This allows adding a new \fBcolor\fP, \fBicolor\fP,
389
\fBheader\fP, \fBmagic\fP, \fBcomment\fP, \fBlinter\fP, or \fBformatter\fP
390
command to an already defined syntax -- useful when you want to
391
slightly improve a syntax defined in one of the system-installed
392
files (which normally are not writable).
393

394
.SH REBINDING KEYS
395
Key bindings can be changed via the following two commands:
396
.TP
397
.BI bind " key function menu"
398
Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
399
400
context of menu \fImenu\fP (or in all menus where the function exists
by using \fBall\fP).
401
.TP
402
.BI unbind " key menu"
403
Unbinds the key \fIkey\fP from the menu named \fImenu\fP (or from all
404
405
406
407
menus where it exists by using \fBall\fP).

.TP
The format of \fIkey\fP should be one of:
408
409
.RS 3
.TP 3
410
.B ^
411
412
followed by an alpha character or the word "Space".
Example: ^C
413
.TP
414
.B M-
415
followed by a printable character or the word "Space".
416
Example: M-C
417
.TP
418
.B F
419
followed by a numeric value from 1 to 16.
420
Example: F10
421
.RE
422

423
.TP
424
Valid \fIfunction\fP names to be bound are:
425
.RS 3
426
.TP 2
427
.B help
428
Invokes the help viewer.
429
430
.TP
.B cancel
431
Cancels the current command.
432
433
.TP
.B exit
434
Exits from the program (or from the help viewer or the file browser).
435
436
.TP
.B writeout
437
438
439
440
Writes the current buffer to disk, asking for a name.
.TP
.B savefile
Writes the current file to disk without prompting or warning.
441
442
.TP
.B insert
443
444
Inserts a file into the current buffer (at the current cursor position),
or into a new buffer when option \fBmultibuffer\fR is set.
445
446
.TP
.B whereis
447
448
Searches for text in the current buffer -- or for filenames matching
a string in the current list in the file browser.
449
450
.TP
.B searchagain
451
Repeats the last search command without prompting.
452
(The form 'research' is deprecated.)
453
454
455
456
457
458
.TP
.B findprevious
As \fBsearchagain\fR, but always in the backward direction.
.TP
.B findnext
As \fBsearchagain\fR, but always in the forward direction.
459
.TP
460
.B replace
461
Interactively replaces text within the current buffer.
462
463
.TP
.B cut
464
Cuts and stores the current line (or the marked region).
465
.TP
466
.B copytext
467
Copies the current line (or the marked region) without deleting it.
468
.TP
469
.B uncut
470
471
Copies the currently stored text into the current buffer at the
current cursor position.
472
.TP
473
.B mark
474
Sets the mark at the current position, to start selecting text.
475
.TP
476
477
478
479
480
481
.B cutwordleft
Cuts from the cursor position to the beginning of the preceding word.
.TP
.B cutwordright
Cuts from the cursor position to the beginning of the next word.
.TP
482
.B cutrestoffile
483
Cuts all text from the cursor position till the end of the buffer.
484
.TP
485
.B curpos
486
Shows the current cursor position: the line, column, and character positions.
487
(The form 'cursorpos' is deprecated.)
488
.TP
489
.B wordcount
490
Counts the number of words, lines and characters in the current buffer.
491
.TP
492
.B speller
493
Invokes a spell-checking program (or a linting program, if the current
494
495
syntax highlighting defines one).
.TP
496
497
498
.B linter
A synonym of \fBspeller\fR (for when the speller has not been configured).
.TP
499
.B justify
500
Justifies the current paragraph.
501
.TP
502
.B fulljustify
503
Justifies the entire current buffer.
504
505
.TP
.B indent
506
Indents (shifts to the right) the currently marked text.
507
508
.TP
.B unindent
509
Unindents (shifts to the left) the currently marked text.
510
.TP
511
512
513
514
.B comment
Comments or uncomments the current line or marked lines, using the comment
style specified in the active syntax.
.TP
515
516
517
518
.B complete
Completes the fragment before the cursor to a full word found elsewhere
in the current buffer.
.TP
519
.B left
520
Goes left one position (in the editor or browser).
521
522
.TP
.B right
523
Goes right one position (in the editor or browser).
524
525
.TP
.B up
526
Goes one line up (in the editor or browser).
527
528
.TP
.B down
529
Goes one line down (in the editor or browser).
530
531
.TP
.B scrollup
532
Scrolls up one line of text from the current position.
533
534
.TP
.B scrolldown
535
Scrolls down one line of text from the current position.
536
.TP
537
.B prevword
538
Moves the cursor to the beginning of the previous word.
539
.TP
540
541
542
.B nextword
Moves the cursor to the beginning of the next word.
.TP
543
.B home
544
Moves the cursor to the beginning of the current line.
545
546
.TP
.B end
547
Moves the cursor to the end of the current line.
548
549
.TP
.B beginpara
550
Moves the cursor to the beginning of the current paragraph.
551
552
.TP
.B endpara
553
Moves the cursor to the end of the current paragraph.
554
.TP
555
556
557
558
559
560
561
.B prevblock
Moves the cursor to the beginning of the current or preceding block of text.
(Blocks are separated by one or more blank lines.)
.TP
.B nextblock
Moves the cursor to the beginning of the next block of text.
.TP
562
.B prevpage
563
Goes up one screenful.
564
565
.TP
.B nextpage
566
Goes down one screenful.
567
568
.TP
.B firstline
569
Goes to the first line of the file.
570
571
.TP
.B lastline
572
Goes to the last line of the file.
573
574
.TP
.B gotoline
575
576
Goes to a specific line (and column if specified).  Negative numbers count
from the end of the file (and end of the line).
577
.TP
578
.B gototext
579
Switches from targeting a line number to searching for text.
580
.TP
581
.B findbracket
582
Moves the cursor to the bracket (brace, parenthesis, etc.) that matches
583
(pairs) with the one under the cursor.
584
585
.TP
.B prevbuf
586
Switches to editing/viewing the previous buffer when multiple buffers are open.
587
588
.TP
.B nextbuf
589
Switches to editing/viewing the next buffer when multiple buffers are open.
590
591
.TP
.B verbatim
592
Inserts the next keystroke verbatim into the file.
593
594
.TP
.B tab
595
Inserts a tab at the current cursor location.
596
597
.TP
.B enter
598
Inserts a new line below the current one.
599
600
.TP
.B delete
601
Deletes the character under the cursor.
602
.TP
603
.B backspace
604
Deletes the character before the cursor.
605
.TP
606
.B undo
607
Undoes the last performed text action (add text, delete text, etc).
608
.TP
609
.B redo
610
Redoes the last undone action (i.e., it undoes an undo).
611
.TP
612
.B refresh
613
Refreshes the screen.
614
.TP
615
.B suspend
616
Suspends the editor (if the suspending function is enabled, see the
617
"suspendenable" entry below).
618
.TP
619
.B casesens
620
Toggles case sensitivity in searching (search/replace menus only).
621
622
.TP
.B regexp
623
Toggles whether searching/replacing is based on literal strings or regular expressions.
624
(The form 'regex' is deprecated.)
625
.TP
626
.B backwards
627
Toggles whether searching/replacing goes forward or backward.
628
.TP
629
.B prevhistory
630
Shows the previous history entry in the prompt menus (e.g. search).
631
632
.TP
.B nexthistory
633
Shows the next history entry in the prompt menus (e.g. search).
634
.TP
635
636
.B flipreplace
Toggles between searching for something and replacing something.
637
(The form 'dontreplace' is deprecated.)
638
.TP
639
640
641
.B flipexecute
Toggles between inserting a file and executing a command.
.TP
642
643
644
.B flipnewbuffer
Toggles between inserting into the current buffer and into a new
empty buffer.
645
(The form 'newbuffer' is deprecated.)
646
.TP
647
.B dosformat
648
When writing a file, switches to writing a DOS format (CR/LF).
649
650
.TP
.B macformat
651
When writing a file, switches to writing a Mac format.
652
653
.TP
.B append
654
When writing a file, appends to the end instead of overwriting.
655
656
.TP
.B prepend
657
When writing a file, 'prepends' (writes at the beginning) instead of overwriting.
658
659
.TP
.B backup
660
When writing a file, creates a backup of the current file.
661
.TP
662
663
664
665
666
.B discardbuffer
When about to write a file, discard the current buffer without saving.
(This function is bound by default only when option \fB\-\-tempfile\fR
is in effect.)
.TP
667
668
669
670
671
672
673
.B tofiles
Starts the file browser, allowing to select a file from a list.
.TP
.B gotodir
Goes to a directory to be specified, allowing to browse anywhere
in the filesystem.
.TP
674
.B firstfile
675
Goes to the first file when using the file browser (reading or writing files).
676
677
.TP
.B lastfile
678
Goes to the last file when using the file browser (reading or writing files).
679
680
.TP
.B nohelp
681
Toggles the presence of the two-line list of key bindings at the bottom of the screen.
682
683
.TP
.B constupdate
684
Toggles the constant display of the current line, column, and character positions.
685
686
.TP
.B morespace
687
Toggles the presence of the blank line that 'separates' the title bar from the file text.
688
689
.TP
.B smoothscroll
690
Toggles smooth scrolling (when moving around with the arrow keys).
691
.TP
692
.B softwrap
693
Toggles the displaying of overlong lines on multiple screen lines.
694
.TP
695
.B whitespacedisplay
696
Toggles the showing of whitespace.
697
698
.TP
.B nosyntax
699
Toggles syntax highlighting.
700
701
.TP
.B smarthome
702
Toggles the smartness of the Home key.
703
704
.TP
.B autoindent
705
Toggles whether new lines will contain the same amount of whitespace as the preceding line.
706
707
.TP
.B cuttoend
708
Toggles whether cutting text will cut the whole line or just from the current cursor
709
position to the end of the line.
710
711
.TP
.B nowrap
712
Toggles whether long lines will be hard-wrapped to the next line.
713
714
.TP
.B tabstospaces
715
Toggles whether typed tabs will be converted to spaces.
716
717
.TP
.B backupfile
718
Toggles whether a backup will be made of the file being edited.
719
720
.TP
.B multibuffer
721
722
Toggles whether a file is inserted into the current buffer
or read into a new buffer.
723
724
.TP
.B mouse
725
Toggles mouse support.
726
727
.TP
.B noconvert
728
Toggles automatic conversion of files from DOS/Mac format.
729
.TP
730
.B suspendenable
731
Toggles whether the suspend sequence (normally ^Z) will suspend the editor window.
Benno Schulenberg's avatar
Oops.    
Benno Schulenberg committed
732
.RE
733

Benno Schulenberg's avatar
Oops.    
Benno Schulenberg committed
734
.TP
735
Valid \fImenu\fP sections are:
Benno Schulenberg's avatar
Oops.    
Benno Schulenberg committed
736
.RS 3
737
.TP 2
738
.B main
739
The main editor window where text is entered and edited.
740
741
.TP
.B search
742
The search menu (AKA whereis).
743
744
.TP
.B replace
745
The 'search to replace' menu.
746
747
.TP
.B replacewith
748
The 'replace with' menu, which comes up after 'search to replace'.
749
(The form 'replace2' is deprecated.)
750
751
.TP
.B gotoline
752
The 'goto line (and column)' menu.
753
754
.TP
.B writeout
755
The 'write file' menu.
756
757
.TP
.B insert
758
The 'insert file' menu.
759
760
.TP
.B extcmd
761
The menu for inserting output from an external command, reached from the insert menu.
762
763
.TP
.B help
764
The help-viewer menu.
765
766
.TP
.B spell
767
The interactive spell checker Yes/no menu.
768
.TP
769
770
771
.B linter
The linter menu.
.TP
772
.B browser
773
The file browser for inserting or writing a file.
774
775
.TP
.B whereisfile
776
The 'search for a file' menu in the file browser.
777
778
.TP
.B gotodir
779
The 'go to directory' menu in the file browser.
780
781
.TP
.B all
782
783
784
A special name that encompasses all menus.
For \fBbind\fR it means all menus where the specified \fIfunction\fR exists;
for \fBunbind\fR it means all menus where the specified \fIkey\fR exists.
785
.RE
786

787
788
.SH FILES
.TP
789
790
.B /etc/nanorc
System-wide configuration file.
791
.TP
792
.B ~/.nanorc
793
Per-user configuration file.
794

Jordi Mallach's avatar
Jordi Mallach committed
795
.SH SEE ALSO
796
797
.BR nano (1)

Jordi Mallach's avatar
Jordi Mallach committed
798
.SH AUTHOR
799
Chris Allegretta and others (see the files \fIAUTHORS\fP and
800
\fITHANKS\fP for details).  This manual page was originally written by
801
Jordi Mallach for the Debian system (but may be used by others).