nanorc.5 26.9 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.9.6" "April 2018"
20

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

Jordi Mallach's avatar
Jordi Mallach committed
24
.SH DESCRIPTION
25
26
27
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
28
system-wide settings, from \fB/etc/nanorc\fP (the exact path might be
29
30
31
different on your system), and then the user-specific settings, either
from \fB~/.nanorc\fR or from \fI$XDG_CONFIG_HOME\fB/nano/nanorc\fR
or from \fB~/.config/nano/nanorc\fR, whichever is encountered first.
Jordi Mallach's avatar
Jordi Mallach committed
32
33

.SH OPTIONS
34
35
The configuration file accepts a series of \fBset\fP and \fBunset\fP
commands, which can be used to configure nano on startup without using
36
37
38
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.
39
.PP
40
Options in \fInanorc\fP files take precedence over nano's defaults, and
41
42
43
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
44
\fInanorc\fR file in your own \fInanorc\fR.  Options that take an
45
46
47
48
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
49
backslashes.  The last double quote in the string will be treated as its
50
51
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.
52
.PP
Jordi Mallach's avatar
Jordi Mallach committed
53
54
55
The supported commands and arguments are:

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

.SH SYNTAX HIGHLIGHTING
Coloring the different syntactic elements of a file
301
302
303
304
305
306
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
307
For each kind of file a separate syntax can be defined
308
via the following commands:
309
.TP
310
.BR syntax " ""\fIname\fR"" [""\fIfileregex\fR"" ...]"
311
312
313
314
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.
315

316
317
318
319
320
321
322
323
324
325
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.
326
.TP
327
328
329
330
331
332
333
334
335
336
337
338
339
.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
340
.BI linter " program " \fR[ "arg " \fR...]
341
342
Use the given \fIprogram\fR to run a syntax check on the current file.
(This overrides the speller function.)
343
.TP
344
.BI formatter " program " \fR[ "arg " \fR...]
345
346
347
Use the given \fIprogram\fR to automatically reformat text --
useful in a programming language like Go.
(This overrides the speller and linter functions.)
348
.TP
349
.BR comment " ""\fIstring\fR"""
350
351
352
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
353
354
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
355
356
357
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.
358
The default value is "\fB#\fP".
359
.TP
360
.B color \fIfgcolor\fR,\fIbgcolor\fR """\fIregex\fR""" ...
361
Display all pieces of text that match
362
363
the extended regular expression \fIregex\fP with foreground color
\fIfgcolor\fP and background color \fIbgcolor\fP, at least one of which
364
must be specified.  Valid colors for foreground and background
365
are: white, black, red, blue, green, yellow, magenta, and cyan.  You may
366
use the prefix "bright" to get a stronger color highlight for the
367
368
369
foreground.  If your terminal supports transparency, not specifying a
\fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent
background.
370
.TP
371
.B icolor \fIfgcolor\fR,\fIbgcolor\fR """\fIregex\fR""" ...
372
Same as above, except that the matching is case insensitive.
373
.TP
374
.BR color " \fIfgcolor\fR,\fIbgcolor\fR " start= """\fIfromrx\fR"" " end= """\fItorx\fR""
375
Display all pieces of text whose start matches extended regular expression
376
\fIfromrx\fP and whose end matches extended regular expression \fItorx\fP with
377
foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
378
at least one of which must be specified.  This means that, after an
379
380
initial instance of \fIfromrx\fP, all text until the first instance of
\fItorx\fP will be colored.  This allows syntax highlighting to span
381
multiple lines.
382
.TP
383
384
.BR icolor " \fIfgcolor\fR,\fIbgcolor\fR " start= """\fIfromrx\fR"" " end= """\fItorx\fR""
Same as above, except that the matching is case insensitive.
385
.TP
386
.BR include " ""\fIsyntaxfile\fR"""
387
Read in self-contained color syntaxes from \fIsyntaxfile\fP.  Note that
388
\fIsyntaxfile\fP may contain only the above commands, from \fBsyntax\fP
389
to \fBicolor\fP.
390
.TP
391
392
393
.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,
394
\fBheader\fP, \fBmagic\fP, \fBcomment\fP, \fBlinter\fP, or \fBformatter\fP
395
command to an already defined syntax -- useful when you want to
396
slightly improve a syntax defined in one of the system-installed
397
files (which normally are not writable).
398

399
.SH REBINDING KEYS
400
401
Key bindings can be changed via the following three commands:
.RS 3
402
.TP
403
.BI bind " key function menu"
404
Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
405
406
context of menu \fImenu\fP (or in all menus where the function exists
by using \fBall\fP).
407
408
409
410
411
412
413
414
.TP
.BI bind " key " """" string """" " menu"
Makes the given \fIkey\fR produce the given \fIstring\fR in the given
\fImenu\fR (or in all menus where the key exists when \fBall\fR is used).
The \fIstring\fR can consist of text or commands or a mix of them.
(To enter a command into the \fIstring\fR, precede its keystroke
with \fBM-V\fR.)

415
.TP
416
.BI unbind " key menu"
417
Unbinds the key \fIkey\fP from the menu named \fImenu\fP (or from all
418
menus where it exists by using \fBall\fP).
419
.RE
420
421
422

.TP
The format of \fIkey\fP should be one of:
423
424
.RS 3
.TP 3
425
.B ^
426
427
followed by an alpha character or the word "Space".
Example: ^C
428
.TP
429
.B M-
430
followed by a printable character or the word "Space".
431
Example: M-C
432
.TP
433
.B F
434
followed by a numeric value from 1 to 16.
435
Example: F10
436
.RE
437

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

Benno Schulenberg's avatar
Oops.    
Benno Schulenberg committed
760
.TP
761
Valid \fImenu\fP sections are:
Benno Schulenberg's avatar
Oops.    
Benno Schulenberg committed
762
.RS 3
763
.TP 2
764
.B main
765
The main editor window where text is entered and edited.
766
767
.TP
.B search
768
The search menu (AKA whereis).
769
770
.TP
.B replace
771
The 'search to replace' menu.
772
773
.TP
.B replacewith
774
The 'replace with' menu, which comes up after 'search to replace'.
775
776
.TP
.B gotoline
777
The 'goto line (and column)' menu.
778
779
.TP
.B writeout
780
The 'write file' menu.
781
782
.TP
.B insert
783
The 'insert file' menu.
784
785
.TP
.B extcmd
786
The menu for inserting output from an external command, reached from the insert menu.
787
788
.TP
.B help
789
The help-viewer menu.
790
791
.TP
.B spell
792
The interactive spell checker Yes/no menu.
793
.TP
794
795
796
.B linter
The linter menu.
.TP
797
.B browser
798
The file browser for inserting or writing a file.
799
800
.TP
.B whereisfile
801
The 'search for a file' menu in the file browser.
802
803
.TP
.B gotodir
804
The 'go to directory' menu in the file browser.
805
806
.TP
.B all
807
808
809
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.
810
.RE
811

812
813
.SH FILES
.TP
814
815
.B /etc/nanorc
System-wide configuration file.
816
.TP
817
.BR ~/.nanorc " or " \fI$XDG_CONFIG_HOME\fB/nano/nanorc " or " ~/.config/nano/nanorc
818
Per-user configuration file.
819

Jordi Mallach's avatar
Jordi Mallach committed
820
.SH SEE ALSO
821
822
.BR nano (1)

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