2024-01-10 13:24:28 +03:00
|
|
|
.\" Copyright (C) 1999-2011, 2013-2024 Free Software Foundation, Inc.
|
2000-12-03 05:46:02 +03:00
|
|
|
.\"
|
2007-08-23 08:34:35 +04:00
|
|
|
.\" 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
|
2018-11-11 14:28:40 +03:00
|
|
|
.\" <https://www.gnu.org/licenses/>.
|
2007-08-23 08:34:35 +04:00
|
|
|
.\"
|
|
|
|
.\" * 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
|
2018-11-11 14:28:40 +03:00
|
|
|
.\" <https://www.gnu.org/licenses/>.
|
2000-12-03 05:46:02 +03:00
|
|
|
.\"
|
2024-05-01 11:01:44 +03:00
|
|
|
.TH NANO 1 "version 8.0" "May 2024"
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH NAME
|
2023-05-13 18:17:36 +03:00
|
|
|
nano \- Nano's ANOther text editor, inspired by Pico
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B nano
|
2019-08-20 20:12:57 +03:00
|
|
|
.RI [ options "] [[\fB+" line [\fB, column "]] " file ]...
|
|
|
|
.sp
|
2023-04-30 18:24:23 +03:00
|
|
|
.BR nano " [" \fIoptions "] [[" + [ crCR ]{ / | ? } \fIstring "] " \fIfile ]...
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2023-11-20 18:31:04 +03:00
|
|
|
.SH NOTICE
|
|
|
|
Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search,
|
|
|
|
\fB^B\fR starts a backward search, \fBM\-F\fR searches the next occurrence
|
|
|
|
forward, and \fBM\-B\fR searches the next occurrence backward. If you want
|
|
|
|
those keystrokes to do what they did before version 8.0, add the following
|
|
|
|
lines at the end of your \fInanorc\fR file:
|
|
|
|
.sp
|
|
|
|
.RS 4
|
|
|
|
.B bind ^F forward main
|
|
|
|
.br
|
|
|
|
.B bind ^B back main
|
|
|
|
.br
|
|
|
|
.B bind M\-F formatter main
|
|
|
|
.br
|
|
|
|
.B bind M\-B linter main
|
|
|
|
.RE
|
|
|
|
.sp
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH DESCRIPTION
|
2023-05-13 18:17:36 +03:00
|
|
|
\fBnano\fP is a small and friendly text editor. It copies the look and feel
|
2017-04-19 21:31:04 +03:00
|
|
|
of Pico, but is free software, and implements several features that Pico
|
|
|
|
lacks, such as: opening multiple files, scrolling per line, undo/redo,
|
|
|
|
syntax coloring, line numbering, and soft-wrapping overlong lines.
|
2019-08-20 20:12:57 +03:00
|
|
|
.sp
|
2017-04-24 21:29:41 +03:00
|
|
|
When giving a filename on the command line, the cursor can be put on a
|
2017-04-19 21:31:04 +03:00
|
|
|
specific line by adding the line number with a plus sign (\fB+\fR) before
|
|
|
|
the filename, and even in a specific column by adding it with a comma.
|
2023-03-09 18:14:44 +03:00
|
|
|
Negative numbers count from the end of the file or line.
|
|
|
|
.sp
|
2019-08-20 20:12:57 +03:00
|
|
|
The cursor can be put on the first or last occurrence of a specific string
|
|
|
|
by specifying that string after \fB+/\fR or \fB+?\fR before the filename.
|
|
|
|
The string can be made case sensitive and/or caused to be interpreted as a
|
|
|
|
regular expression by inserting \fBc\fR and/or \fBr\fR after the \fB+\fR sign.
|
|
|
|
These search modes can be explicitly disabled by using the uppercase variant
|
|
|
|
of those letters: \fBC\fR and/or \fBR\fR. When the string contains spaces,
|
|
|
|
it needs to be enclosed in quotes. To give an example: to open a file at
|
2021-08-23 11:04:01 +03:00
|
|
|
the first occurrence of the word "Foo", you would do:
|
2019-08-20 20:12:57 +03:00
|
|
|
.sp
|
|
|
|
.RS 4
|
|
|
|
.BI "nano +c/Foo " file
|
|
|
|
.RE
|
|
|
|
.sp
|
2017-06-29 21:56:58 +03:00
|
|
|
As a special case: if instead of a filename a dash (\fB\-\fR) is given,
|
|
|
|
\fBnano\fR will read data from standard input.
|
2017-01-25 23:55:26 +03:00
|
|
|
|
2015-06-07 23:14:41 +03:00
|
|
|
.SH EDITING
|
|
|
|
Entering text and moving around in a file is straightforward: typing the
|
|
|
|
letters and using the normal cursor movement keys. Commands are entered
|
2016-10-22 23:07:02 +03:00
|
|
|
by using the Control (^) and the Alt or Meta (M\-) keys.
|
2015-06-07 23:14:41 +03:00
|
|
|
Typing \fB^K\fR deletes the current line and puts it in the cutbuffer.
|
2024-06-17 17:31:17 +03:00
|
|
|
Consecutive \fB^K\fRs put all deleted lines together in the cutbuffer.
|
|
|
|
Any cursor movement or executing any other command causes the next
|
|
|
|
\fB^K\fR to overwrite the cutbuffer. A \fB^U\fR pastes the current
|
2015-06-07 23:14:41 +03:00
|
|
|
contents of the cutbuffer at the current cursor position.
|
2019-04-01 18:31:35 +03:00
|
|
|
.sp
|
2021-08-23 11:04:01 +03:00
|
|
|
When a more precise piece of text needs to be cut or copied, you can mark
|
2024-06-17 17:31:17 +03:00
|
|
|
its start with \fB^6\fR, move the cursor to its end (the marked text is
|
2016-10-22 23:07:02 +03:00
|
|
|
highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to the
|
2021-08-23 11:04:01 +03:00
|
|
|
cutbuffer. You can also save the marked text to a file with \fB^O\fR, or
|
2021-08-28 11:20:31 +03:00
|
|
|
spell check it with \fB^T^T\fR.
|
2019-04-01 18:31:35 +03:00
|
|
|
.sp
|
2018-02-27 11:48:46 +03:00
|
|
|
On some terminals, text can be selected also by holding down Shift while
|
2024-06-17 17:31:17 +03:00
|
|
|
using the arrow keys. Holding down the Ctrl or Alt key too increases
|
2018-07-10 16:52:03 +03:00
|
|
|
the stride.
|
2024-06-17 17:31:17 +03:00
|
|
|
Any cursor movement without Shift being held cancels such a selection.
|
2019-04-01 18:31:35 +03:00
|
|
|
.sp
|
2022-09-13 12:01:03 +03:00
|
|
|
Any valid Unicode code point can be inserted into the buffer by typing
|
|
|
|
\fBM\-V\fR followed by the hexadecimal digits of the code point (concluded
|
|
|
|
with \fB<Space>\fR or \fB<Enter>\fR when it are fewer than six digits).
|
|
|
|
A literal control code (except \fB^J\fR) can be inserted by typing
|
|
|
|
\fBM\-V\fR followed by the pertinent keystroke.
|
|
|
|
.sp
|
2017-04-19 21:31:04 +03:00
|
|
|
The two lines at the bottom of the screen show some important commands;
|
2015-06-07 23:14:41 +03:00
|
|
|
the built-in help (\fB^G\fR) lists all the available ones.
|
2017-11-17 23:40:54 +03:00
|
|
|
The default key bindings can be changed via a \fInanorc\fR file -- see
|
2015-06-07 23:14:41 +03:00
|
|
|
.BR nanorc (5).
|
|
|
|
|
2024-06-06 13:17:45 +03:00
|
|
|
.\" Never hyphenate these:
|
|
|
|
.hw ncurses terminfo
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-A ", " \-\-smarthome
|
2004-05-23 00:15:20 +04:00
|
|
|
Make the Home key smarter. When Home is pressed anywhere but at the
|
2024-06-17 17:31:17 +03:00
|
|
|
very beginning of non-whitespace characters on a line, the cursor jumps
|
|
|
|
to that beginning (either forwards or backwards). If the cursor is
|
|
|
|
already at that position, it jumps to the true beginning of the line.
|
2004-05-23 00:15:20 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-B ", " \-\-backup
|
2015-06-07 21:45:34 +03:00
|
|
|
When saving a file, back up the previous version of it, using the current
|
2014-05-07 00:43:00 +04:00
|
|
|
filename suffixed with a tilde (\fB~\fP).
|
2002-06-29 02:45:14 +04:00
|
|
|
.TP
|
2017-09-30 20:42:06 +03:00
|
|
|
.BR \-C\ \fIdirectory ", " \-\-backupdir= \fIdirectory
|
2015-06-07 21:45:34 +03:00
|
|
|
Make and keep not just one backup file, but make and keep a uniquely
|
2017-04-19 21:31:04 +03:00
|
|
|
numbered one every time a file is saved -- when backups are enabled (\fB\-B\fR).
|
2015-06-07 21:45:34 +03:00
|
|
|
The uniquely numbered files are stored in the specified \fIdirectory\fR.
|
2004-02-28 19:24:31 +03:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-D ", " \-\-boldtext
|
2024-06-04 17:51:11 +03:00
|
|
|
For the interface, use bold instead of reverse video.
|
|
|
|
This can be overridden for specific elements by setting the options
|
|
|
|
\fBtitlecolor\fP, \fBstatuscolor\fP, \fBpromptcolor\fP, \fBminicolor\fP,
|
|
|
|
\fBkeycolor\fP, \fBnumbercolor\fP, and/or \fBselectedcolor\fP in your
|
2020-02-06 17:52:35 +03:00
|
|
|
nanorc file. See \fBnanorc\fR(5).
|
2006-04-12 19:27:40 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-E ", " \-\-tabstospaces
|
2021-07-01 10:47:41 +03:00
|
|
|
Convert each typed tab to spaces -- to the number of spaces
|
|
|
|
that a tab at that position would take up.
|
2023-01-26 17:01:08 +03:00
|
|
|
(Note: pasted tabs are not converted.)
|
2005-06-16 03:20:56 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-F ", " \-\-multibuffer
|
2017-04-19 21:31:04 +03:00
|
|
|
Read a file into a new buffer by default.
|
2001-07-15 20:07:23 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-G ", " \-\-locking
|
2017-04-19 21:31:04 +03:00
|
|
|
Use vim-style file locking when editing files.
|
2013-01-01 07:24:39 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-H ", " \-\-historylog
|
2017-11-17 23:40:54 +03:00
|
|
|
Save the last hundred search strings and replacement strings and
|
|
|
|
executed commands, so they can be easily reused in later sessions.
|
2003-01-17 06:06:28 +03:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-I ", " \-\-ignorercfiles
|
2017-11-17 23:40:54 +03:00
|
|
|
Don't look at the system's \fInanorc\fR nor at the user's \fInanorc\fR.
|
2002-07-20 17:57:41 +04:00
|
|
|
.TP
|
2019-03-03 13:38:53 +03:00
|
|
|
.BR \-J\ \fInumber ", " \-\-guidestripe= \fInumber
|
|
|
|
Draw a vertical stripe at the given column, to help judge the width of the
|
|
|
|
text. (The color of the stripe can be changed with \fBset stripecolor\fR
|
|
|
|
in your \fInanorc\fR file.)
|
|
|
|
.TP
|
2018-12-23 21:45:34 +03:00
|
|
|
.BR \-K ", " \-\-rawsequences
|
2021-12-13 18:44:25 +03:00
|
|
|
Interpret escape sequences directly, instead of asking \fBncurses\fR
|
|
|
|
to translate them. (If you need this option to get some keys to work
|
2024-06-06 13:17:45 +03:00
|
|
|
properly, it means that the \fBterminfo\fR terminal description that is used
|
2021-12-13 18:44:25 +03:00
|
|
|
does not fully match the actual behavior of your terminal. This can
|
|
|
|
happen when you ssh into a BSD machine, for example.)
|
|
|
|
Using this option disables \fBnano\fR's mouse support.
|
2005-08-11 02:51:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-L ", " \-\-nonewlines
|
2019-06-04 20:54:58 +03:00
|
|
|
Don't automatically add a newline when a text does not end with one.
|
|
|
|
(This can cause you to save non-POSIX text files.)
|
2005-11-05 20:35:44 +03:00
|
|
|
.TP
|
2018-01-23 15:44:03 +03:00
|
|
|
.BR \-M ", " \-\-trimblanks
|
|
|
|
Snip trailing whitespace from the wrapped line when automatic
|
|
|
|
hard-wrapping occurs or when text is justified.
|
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-N ", " \-\-noconvert
|
2002-02-22 07:30:50 +03:00
|
|
|
Disable automatic conversion of files from DOS/Mac format.
|
|
|
|
.TP
|
2020-06-24 10:17:25 +03:00
|
|
|
.BR \-O ", " \-\-bookstyle
|
|
|
|
When justifying, treat any line that starts with whitespace as the
|
|
|
|
beginning of a paragraph (unless auto-indenting is on).
|
|
|
|
.TP
|
2015-07-15 22:50:55 +03:00
|
|
|
.BR \-P ", " \-\-positionlog
|
2016-01-25 23:51:00 +03:00
|
|
|
For the 200 most recent files, log the last position of the cursor,
|
|
|
|
and place it at that position again upon reopening such a file.
|
2013-06-14 06:31:38 +04:00
|
|
|
.TP
|
2018-05-22 19:25:59 +03:00
|
|
|
.BR "\-Q ""\fIregex\fB""" ", " "\-\-quotestr=""" \fIregex """
|
|
|
|
Set the regular expression for matching the quoting part of a line.
|
2020-09-05 20:18:51 +03:00
|
|
|
The default value is "\fB^([\ \\t]*([!#%:;>|}]|//))+\fR".
|
2019-01-23 21:57:17 +03:00
|
|
|
(Note that \fB\\t\fP stands for an actual Tab.)
|
|
|
|
This makes it possible to rejustify blocks of quoted text when composing
|
|
|
|
email, and to rewrap blocks of line comments when writing source code.
|
2002-03-04 15:15:44 +03:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-R ", " \-\-restricted
|
2006-05-01 17:22:47 +04:00
|
|
|
Restricted mode: don't read or write to any file not specified on the
|
2018-09-30 14:36:45 +03:00
|
|
|
command line. This means: don't read or write history files;
|
|
|
|
don't allow suspending; don't allow spell checking;
|
2014-05-07 00:43:00 +04:00
|
|
|
don't allow a file to be appended to, prepended to, or saved under a
|
2018-09-30 14:36:45 +03:00
|
|
|
different name if it already has one; and don't make backup files.
|
|
|
|
Restricted mode can also be activated by invoking \fBnano\fP
|
2014-05-07 00:43:00 +04:00
|
|
|
with any name beginning with 'r' (e.g. "rnano").
|
2005-06-18 02:53:41 +04:00
|
|
|
.TP
|
2020-03-27 18:57:25 +03:00
|
|
|
.BR \-S ", " \-\-softwrap
|
|
|
|
Display over multiple screen rows lines that exceed the screen's width.
|
|
|
|
(You can make this soft-wrapping occur at whitespace instead of rudely at
|
|
|
|
the screen's edge, by using also \fB\-\-atblanks\fR.)
|
|
|
|
.TP
|
2017-09-30 20:42:06 +03:00
|
|
|
.BR \-T\ \fInumber ", " \-\-tabsize= \fInumber
|
2014-05-07 00:43:00 +04:00
|
|
|
Set the size (width) of a tab to \fInumber\fP columns. The value of
|
2020-09-05 20:18:51 +03:00
|
|
|
\fInumber\fR must be greater than 0. The default value is \fB8\fR.
|
2001-10-03 16:45:22 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-U ", " \-\-quickblank
|
2021-02-22 14:20:39 +03:00
|
|
|
Make status-bar messages disappear after 1 keystroke instead of after 20.
|
2021-11-29 12:47:49 +03:00
|
|
|
Note that option \fB\-c\fR (\fB\-\-constantshow\fR) overrides this.
|
|
|
|
When option \fB\-\-minibar\fR or \fB\-\-zero\fR is in effect,
|
|
|
|
\fB\-\-quickblank\fR makes a message disappear after
|
|
|
|
0.8 seconds instead of after the default 1.5 seconds.
|
|
|
|
.
|
2005-06-17 23:06:25 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-V ", " \-\-version
|
2006-05-01 17:22:47 +04:00
|
|
|
Show the current version number and exit.
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-W ", " \-\-wordbounds
|
2016-06-30 19:02:45 +03:00
|
|
|
Detect word boundaries differently by treating punctuation
|
2005-08-11 02:51:49 +04:00
|
|
|
characters as part of a word.
|
|
|
|
.TP
|
2016-06-30 19:02:45 +03:00
|
|
|
.BR "\-X ""\fIcharacters\fB""" ", " "\-\-wordchars=""" \fIcharacters """
|
|
|
|
Specify which other characters (besides the normal alphanumeric ones)
|
2020-04-06 20:07:02 +03:00
|
|
|
should be considered as part of a word. When using this option, you
|
|
|
|
probably want to omit \fB\-W\fR (\fB\-\-wordbounds\fR).
|
2016-06-30 19:02:45 +03:00
|
|
|
.TP
|
2017-09-30 20:42:06 +03:00
|
|
|
.BR \-Y\ \fIname ", " \-\-syntax= \fIname
|
2014-06-20 19:56:31 +04:00
|
|
|
Specify the name of the syntax highlighting to use from among the ones
|
|
|
|
defined in the \fInanorc\fP files.
|
2002-05-04 08:23:30 +04:00
|
|
|
.TP
|
2018-10-24 12:02:08 +03:00
|
|
|
.BR \-Z ", " \-\-zap
|
|
|
|
Let an unmodified Backspace or Delete erase the marked region
|
|
|
|
(instead of a single character, and without affecting the cutbuffer).
|
|
|
|
.TP
|
2017-06-28 17:57:46 +03:00
|
|
|
.BR \-a ", " \-\-atblanks
|
|
|
|
When doing soft line wrapping, wrap lines at whitespace
|
|
|
|
instead of always at the edge of the screen.
|
|
|
|
.TP
|
2019-01-28 22:43:02 +03:00
|
|
|
.BR \-b ", " \-\-breaklonglines
|
|
|
|
Automatically hard-wrap the current line when it becomes overlong.
|
|
|
|
(This option is the opposite of \fB\-w\fR (\fB\-\-nowrap\fR) --
|
|
|
|
the last one given takes effect.)
|
|
|
|
.TP
|
2015-07-15 22:40:37 +03:00
|
|
|
.BR \-c ", " \-\-constantshow
|
2017-06-18 20:53:18 +03:00
|
|
|
Constantly show the cursor position on the status bar.
|
2017-06-24 20:11:29 +03:00
|
|
|
Note that this overrides option \fB\-U\fR (\fB\-\-quickblank\fR).
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-d ", " \-\-rebinddelete
|
2018-12-28 21:37:02 +03:00
|
|
|
Interpret the Delete and Backspace keys differently so that both Backspace
|
|
|
|
and Delete work properly. You should only use this option when on your
|
|
|
|
system either Backspace acts like Delete or Delete acts like Backspace.
|
2003-08-31 20:44:10 +04:00
|
|
|
.TP
|
2019-01-28 22:43:02 +03:00
|
|
|
.BR \-e ", " \-\-emptyline
|
|
|
|
Do not use the line below the title bar, leaving it entirely blank.
|
|
|
|
.TP
|
2020-01-19 14:50:42 +03:00
|
|
|
.BR \-f\ \fIfile ", " \-\-rcfile= \fIfile
|
|
|
|
Read only this \fIfile\fR for setting nano's options, instead of reading
|
|
|
|
both the system-wide and the user's nanorc files.
|
|
|
|
.TP
|
2016-10-23 13:56:47 +03:00
|
|
|
.BR \-g ", " \-\-showcursor
|
2018-10-07 11:38:11 +03:00
|
|
|
Make the cursor visible in the file browser (putting it on the
|
|
|
|
highlighted item) and in the help viewer. Useful for braille users
|
|
|
|
and people with poor vision.
|
2016-10-23 13:56:47 +03:00
|
|
|
.TP
|
2023-08-27 15:56:05 +03:00
|
|
|
.BR \-h ", " \-\-help
|
2014-03-03 20:08:45 +04:00
|
|
|
Show a summary of the available command-line options and exit.
|
2001-10-03 16:45:22 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-i ", " \-\-autoindent
|
2018-05-30 11:19:57 +03:00
|
|
|
Automatically indent a newly created line to the same number of tabs
|
|
|
|
and/or spaces as the previous line (or as the next line if the previous
|
|
|
|
line is the beginning of a paragraph).
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2019-01-28 22:43:02 +03:00
|
|
|
.BR \-j ", " \-\-jumpyscrolling
|
|
|
|
Scroll the buffer contents per half-screen instead of per line.
|
|
|
|
.TP
|
2017-07-14 17:06:52 +03:00
|
|
|
.BR \-k ", " \-\-cutfromcursor
|
2016-10-22 23:07:02 +03:00
|
|
|
Make the 'Cut Text' command (normally \fB^K\fR) cut from the current cursor
|
2014-05-07 00:43:00 +04:00
|
|
|
position to the end of the line, instead of cutting the entire line.
|
2001-04-30 14:30:43 +04:00
|
|
|
.TP
|
2016-10-20 11:44:29 +03:00
|
|
|
.BR \-l ", " \-\-linenumbers
|
|
|
|
Display line numbers to the left of the text area.
|
2020-08-03 11:22:21 +03:00
|
|
|
(Any line with an anchor additionally gets a mark in the margin.)
|
2016-10-20 11:44:29 +03:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-m ", " \-\-mouse
|
2006-05-25 00:55:44 +04:00
|
|
|
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
|
2024-06-17 17:31:17 +03:00
|
|
|
click), and execute shortcuts. The mouse works in the X Window
|
2014-05-07 00:43:00 +04:00
|
|
|
System, and on the console when gpm is running. Text can still be
|
|
|
|
selected through dragging by holding down the Shift key.
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-n ", " \-\-noread
|
2014-04-08 23:40:37 +04:00
|
|
|
Treat any name given on the command line as a new file. This allows
|
2024-06-17 17:31:17 +03:00
|
|
|
\fBnano\fR to write to named pipes: it starts with a blank buffer,
|
|
|
|
and writes to the pipe when the user saves the "file". This way
|
2014-04-08 23:40:37 +04:00
|
|
|
\fBnano\fR can be used as an editor in combination with for instance
|
|
|
|
\fBgpg\fR without having to write sensitive data to disk first.
|
|
|
|
.TP
|
2017-09-30 20:42:06 +03:00
|
|
|
.BR \-o\ \fIdirectory ", " \-\-operatingdir= \fIdirectory
|
2014-06-20 19:56:31 +04:00
|
|
|
Set the operating directory. This makes \fBnano\fP set up something
|
|
|
|
similar to a chroot.
|
2001-10-03 16:45:22 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-p ", " \-\-preserve
|
2024-06-17 17:31:17 +03:00
|
|
|
Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that
|
|
|
|
they are caught by the terminal (stopping and resuming the output).
|
2024-03-08 13:25:14 +03:00
|
|
|
Note that option \fB\-/\fR (\fB\-\-modernbindings\fR) overrides this.
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2020-05-27 12:10:04 +03:00
|
|
|
.BR \-q ", " \-\-indicator
|
|
|
|
Display a "scrollbar" on the righthand side of the edit window.
|
|
|
|
It shows the position of the viewport in the buffer
|
|
|
|
and how much of the buffer is covered by the viewport.
|
|
|
|
.TP
|
2017-09-30 20:42:06 +03:00
|
|
|
.BR \-r\ \fInumber ", " \-\-fill= \fInumber
|
2019-01-26 12:44:03 +03:00
|
|
|
Set the target width for justifying and automatic hard-wrapping at this
|
2024-06-17 17:31:17 +03:00
|
|
|
\fInumber\fR of columns. If the value is 0 or less, wrapping occurs
|
2019-01-26 12:44:03 +03:00
|
|
|
at the width of the screen minus \fInumber\fR columns, allowing the wrap
|
|
|
|
point to vary along with the width of the screen if the screen is resized.
|
2020-09-05 20:18:51 +03:00
|
|
|
The default value is \fB\-8\fR.
|
2001-04-30 14:30:43 +04:00
|
|
|
.TP
|
2020-02-04 14:23:58 +03:00
|
|
|
.B "\-s ""\fIprogram\fR [\fIargument \fR...]\fB""\fR, \fB\-\-speller=""\fIprogram\fR [\fIargument \fR...]\fB"""
|
2019-11-25 19:38:50 +03:00
|
|
|
Use this command to perform spell checking and correcting, instead of
|
2020-09-05 20:18:51 +03:00
|
|
|
using the built-in corrector that calls \fBhunspell\fR(1) or \fBspell\fR(1).
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2020-04-30 18:25:48 +03:00
|
|
|
.BR \-t ", " \-\-saveonexit
|
2016-10-22 23:07:02 +03:00
|
|
|
Save a changed buffer without prompting (when exiting with \fB^X\fR).
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2015-08-04 21:49:57 +03:00
|
|
|
.BR \-u ", " \-\-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 \fB\-\-noconvert\fR.)
|
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-v ", " \-\-view
|
2016-10-22 23:07:02 +03:00
|
|
|
Just view the file and disallow editing: read-only mode.
|
2018-10-23 20:26:45 +03:00
|
|
|
This mode allows the user to open also other files for viewing,
|
2019-03-24 13:32:01 +03:00
|
|
|
unless \fB\-\-restricted\fR is given too.
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-w ", " \-\-nowrap
|
2019-01-26 12:44:03 +03:00
|
|
|
Do not automatically hard-wrap the current line when it becomes overlong.
|
2019-04-14 09:49:25 +03:00
|
|
|
This is the default. (This option is the opposite of \fB\-b\fR
|
|
|
|
(\fB\-\-breaklonglines\fR) -- the last one given takes effect.)
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2014-08-04 00:25:16 +04:00
|
|
|
.BR \-x ", " \-\-nohelp
|
2014-05-07 00:43:00 +04:00
|
|
|
Don't show the two help lines at the bottom of the screen.
|
2000-06-06 09:53:49 +04:00
|
|
|
.TP
|
2018-04-30 23:10:27 +03:00
|
|
|
.BR \-y ", " \-\-afterends
|
2020-04-12 12:15:28 +03:00
|
|
|
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.
|
2018-04-30 23:10:27 +03:00
|
|
|
.TP
|
2024-05-26 17:41:41 +03:00
|
|
|
.BR \-z ", " \-\-listsyntaxes
|
|
|
|
List the names of the available syntaxes and exit.
|
|
|
|
.TP
|
2022-08-17 15:15:47 +03:00
|
|
|
.BR \-! ", " \-\-magic
|
|
|
|
When neither the file's name nor its first line give a clue,
|
|
|
|
try using libmagic to determine the applicable syntax.
|
|
|
|
.TP
|
2024-05-26 18:01:53 +03:00
|
|
|
.BR \-@ ", " \-\-colonparsing
|
|
|
|
When a filename given on the command line ends in a colon plus digits
|
|
|
|
and this filename does not exist, then snip the colon plus digits and
|
|
|
|
understand the digits as a line number. If the trimmed filename does
|
|
|
|
not exist either, then repeat the process and understand the obtained
|
|
|
|
two numbers as line and column number. But if the doubly trimmed
|
|
|
|
filename does not exist either, then forget the trimming and accept
|
|
|
|
the original filename as is. To disable this colon parsing, use
|
|
|
|
something like \fB+1\fR before the filename.
|
|
|
|
.TP
|
2020-10-01 12:18:45 +03:00
|
|
|
.BR \-% ", " \-\-stateflags
|
|
|
|
Use the top-right corner of the screen for showing some state flags:
|
|
|
|
\fBI\fR when auto-indenting, \fBM\fR when the mark is on, \fBL\fR when
|
|
|
|
hard-wrapping (breaking long lines), \fBR\fR when recording a macro,
|
|
|
|
and \fBS\fR when soft-wrapping.
|
|
|
|
When the buffer is modified, a star (\fB*\fR) is shown after the
|
|
|
|
filename in the center of the title bar.
|
|
|
|
.TP
|
2020-12-23 18:24:54 +03:00
|
|
|
.BR \-_ ", " \-\-minibar
|
|
|
|
Suppress the title bar and instead show information about
|
|
|
|
the current buffer at the bottom of the screen, in the space
|
2024-01-18 19:20:15 +03:00
|
|
|
for the status bar. In this "mini bar" the filename is shown
|
2020-12-23 18:24:54 +03:00
|
|
|
on the left, followed by an asterisk if the buffer has been modified.
|
|
|
|
On the right are displayed the current line and column number, the
|
|
|
|
code of the character under the cursor (in Unicode format: U+xxxx),
|
|
|
|
the same flags as are shown by \fB\-\-stateflags\fR, and a percentage
|
|
|
|
that expresses how far the cursor is into the file (linewise).
|
|
|
|
When a file is loaded or saved, and also when switching between buffers,
|
2021-09-15 11:21:41 +03:00
|
|
|
the number of lines in the buffer is displayed after the filename.
|
2020-12-23 18:24:54 +03:00
|
|
|
This number is cleared upon the next keystroke, or replaced with an
|
|
|
|
[i/n] counter when multiple buffers are open.
|
2021-02-01 21:56:18 +03:00
|
|
|
The line plus column numbers and the character code are displayed only when
|
2022-02-16 14:19:31 +03:00
|
|
|
\fB\-\-constantshow\fR is used, and can be toggled on and off with \fBM\-C\fR.
|
2021-02-01 21:56:18 +03:00
|
|
|
The state flags are displayed only when \fB\-\-stateflags\fR is used.
|
2020-12-23 18:24:54 +03:00
|
|
|
.TP
|
2021-11-09 18:28:37 +03:00
|
|
|
.BR \-0 ", " \-\-zero
|
2021-11-26 13:01:33 +03:00
|
|
|
Hide all elements of the interface (title bar, status bar, and help lines)
|
|
|
|
and use all rows of the terminal for showing the contents of the buffer.
|
2021-11-27 16:16:37 +03:00
|
|
|
The status bar appears only when there is a significant message,
|
2021-11-26 13:01:33 +03:00
|
|
|
and disappears after 1.5 seconds or upon the next keystroke.
|
2022-02-16 14:19:31 +03:00
|
|
|
With \fBM\-Z\fR the title bar plus status bar can be toggled.
|
|
|
|
With \fBM\-X\fR the help lines.
|
2024-01-23 12:52:39 +03:00
|
|
|
.TP
|
|
|
|
.BR \-/ ", " \-\-modernbindings
|
|
|
|
Use key bindings similar to the ones that most modern programs use:
|
|
|
|
\fB^X\fR cuts, \fB^C\fR copies, \fB^V\fR pastes,
|
|
|
|
\fB^Z\fR undoes, \fB^Y\fR redoes,
|
|
|
|
\fB^F\fR searches forward, \fB^G\fR searches next,
|
|
|
|
\fB^S\fR saves, \fB^O\fR opens a file, \fB^Q\fR quits,
|
|
|
|
and (when the terminal permits) \fB^H\fR shows help.
|
|
|
|
Furthermore, \fB^A\fR sets the mark,
|
|
|
|
\fB^R\fR makes replacements, \fB^D\fR searches previous,
|
|
|
|
\fB^P\fR shows the position, \fB^T\fR goes to a line,
|
|
|
|
\fB^W\fR writes out a file, and \fB^E\fR executes a command.
|
2024-03-08 13:25:14 +03:00
|
|
|
Note that this overrides option \fB\-p\fR (\fB\-\-preserve\fR).
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2016-10-22 18:27:15 +03:00
|
|
|
.SH TOGGLES
|
2016-10-22 23:07:02 +03:00
|
|
|
Several of the above options can be switched on and off also while
|
2016-10-22 18:27:15 +03:00
|
|
|
\fBnano\fR is running. For example, \fBM\-L\fR toggles the
|
2019-04-11 18:44:21 +03:00
|
|
|
hard-wrapping of long lines, \fBM\-S\fR toggles soft-wrapping,
|
|
|
|
\fBM\-N\fR toggles line numbers, \fBM\-M\fR toggles the mouse,
|
2016-10-22 23:07:02 +03:00
|
|
|
\fBM\-I\fR auto-indentation, and \fBM\-X\fR the help lines.
|
2016-10-22 18:27:15 +03:00
|
|
|
See at the end of the \fB^G\fR help text for a complete list.
|
2020-06-24 10:30:08 +03:00
|
|
|
.sp
|
|
|
|
The \fBM\-X\fR toggle is special: it works in all menus except
|
|
|
|
the help viewer and the linter. All other toggles work in
|
|
|
|
the main menu only.
|
2016-10-22 18:27:15 +03:00
|
|
|
|
2019-03-25 16:59:28 +03:00
|
|
|
.SH FILES
|
2024-06-17 17:31:17 +03:00
|
|
|
When \fB\-\-rcfile\fR is given, \fBnano\fR reads just the specified file
|
2020-01-19 15:27:41 +03:00
|
|
|
for setting its options and syntaxes and key bindings. Without that option,
|
2024-06-17 17:31:17 +03:00
|
|
|
\fBnano\fR reads two configuration files: first the system's
|
2017-11-17 23:40:54 +03:00
|
|
|
\fInanorc\fR (if it exists), and then the user's \fInanorc\fR (if it
|
2019-03-25 17:31:47 +03:00
|
|
|
exists), either \fI~/.nanorc\fR or \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
|
|
|
or \fI~/.config/nano/nanorc\fR, whichever is encountered first. See
|
2014-06-18 00:30:59 +04:00
|
|
|
.BR nanorc (5)
|
|
|
|
for more information on the possible contents of those files.
|
2020-09-12 13:47:10 +03:00
|
|
|
.sp
|
|
|
|
See \fI/usr/share/nano/\fR and \fI/usr/share/nano/extra/\fR
|
|
|
|
for available syntax-coloring definitions.
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2000-12-03 05:46:02 +03:00
|
|
|
.SH NOTES
|
2022-06-17 17:47:18 +03:00
|
|
|
Suspension is enabled by default, reachable via \fB^T^Z\fR.
|
|
|
|
(If you want a plain \fB^Z\fR to suspend nano, add
|
|
|
|
\fBbind ^Z suspend main\fR to your nanorc.)
|
|
|
|
.sp
|
2023-02-16 12:44:10 +03:00
|
|
|
When you want to copy marked text from \fBnano\fR to the system's clipboard,
|
|
|
|
see one of the examples in the \fBnanorc\fR(5) man page.
|
|
|
|
.sp
|
2004-06-02 02:56:34 +04:00
|
|
|
If no alternative spell checker command is specified on the command
|
2024-06-17 17:31:17 +03:00
|
|
|
line nor in one of the \fInanorc\fP files, \fBnano\fP checks the
|
2004-06-02 02:56:34 +04:00
|
|
|
\fBSPELL\fP environment variable for one.
|
2016-10-22 23:07:02 +03:00
|
|
|
.sp
|
2024-06-17 17:31:17 +03:00
|
|
|
In some cases \fBnano\fP tries to dump the buffer into an emergency
|
|
|
|
file. This happens mainly if \fBnano\fP receives a SIGHUP or
|
|
|
|
SIGTERM or runs out of memory. It writes the buffer into a file
|
|
|
|
named \fInano.save\fP if the buffer didn't have a name already, or
|
|
|
|
adds a ".save" suffix to the current filename. If an emergency file with
|
|
|
|
that name already exists in the current directory, it adds ".save"
|
2014-07-16 15:07:08 +04:00
|
|
|
plus a number (e.g.\& ".save.1") to the current filename in order to make
|
2024-06-17 17:31:17 +03:00
|
|
|
it unique. In multibuffer mode, \fBnano\fP writes all the open
|
2005-06-18 02:11:43 +04:00
|
|
|
buffers to their respective emergency files.
|
2023-01-29 14:17:05 +03:00
|
|
|
.sp
|
|
|
|
If you have any question about how to use \fBnano\fR in some specific
|
|
|
|
situation, you can ask on \fIhelp-nano@gnu.org\fR.
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH BUGS
|
2017-11-13 23:08:36 +03:00
|
|
|
The recording and playback of keyboard macros works correctly only on a
|
2018-03-28 20:34:26 +03:00
|
|
|
terminal emulator, not on a Linux console (VT), because the latter does
|
|
|
|
not by default distinguish modified from unmodified arrow keys.
|
2017-11-13 23:08:36 +03:00
|
|
|
.sp
|
2016-12-11 14:03:50 +03:00
|
|
|
Please report any other bugs that you encounter via:
|
|
|
|
.br
|
2019-03-25 17:31:47 +03:00
|
|
|
.IR https://savannah.gnu.org/bugs/?group=nano .
|
2018-05-06 17:46:41 +03:00
|
|
|
.sp
|
2024-06-17 17:31:17 +03:00
|
|
|
When nano crashes, it saves any modified buffers to emergency .save files.
|
2018-05-06 17:46:41 +03:00
|
|
|
If you are able to reproduce the crash and you want to get a backtrace, define
|
|
|
|
the environment variable \fBNANO_NOCATCH\fR.
|
2003-02-09 04:28:40 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
.SH HOMEPAGE
|
2019-03-25 17:31:47 +03:00
|
|
|
.I https://nano\-editor.org/
|
2003-02-09 04:28:40 +03:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
2016-10-22 23:07:02 +03:00
|
|
|
.BR nanorc (5)
|
2019-04-01 18:31:35 +03:00
|
|
|
.sp
|
2003-02-09 04:28:40 +03:00
|
|
|
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
|