2001-02-12 03:48:53 +00:00
|
|
|
\input texinfo @c -*-texinfo-*-
|
|
|
|
@c %**start of header
|
|
|
|
@setfilename nano.info
|
2015-06-07 10:02:31 +00:00
|
|
|
@settitle nano
|
2001-02-12 03:48:53 +00:00
|
|
|
@c %**end of header
|
|
|
|
|
2017-07-03 12:31:53 +02:00
|
|
|
@documentencoding UTF-8
|
|
|
|
|
2001-02-12 03:48:53 +00:00
|
|
|
@smallbook
|
2017-07-14 13:14:44 +02:00
|
|
|
@set EDITION 0.5
|
2019-12-22 15:34:04 +01:00
|
|
|
@set VERSION 4.7
|
|
|
|
@set UPDATED December 2019
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2001-03-22 23:12:22 +00:00
|
|
|
@dircategory Editors
|
|
|
|
@direntry
|
2002-07-19 01:08:59 +00:00
|
|
|
* nano: (nano). Small and friendly text editor.
|
2001-03-22 23:12:22 +00:00
|
|
|
@end direntry
|
2001-02-12 03:48:53 +00:00
|
|
|
|
|
|
|
@c tex
|
|
|
|
@c \overfullrule=0pt
|
|
|
|
@c end tex
|
|
|
|
|
|
|
|
@titlepage
|
2017-07-14 10:44:59 +02:00
|
|
|
@title GNU @command{nano}
|
2017-04-11 21:37:27 +02:00
|
|
|
@subtitle a small and friendly text editor
|
2019-12-22 15:34:04 +01:00
|
|
|
@subtitle version 4.7
|
2001-02-12 03:48:53 +00:00
|
|
|
|
|
|
|
@author Chris Allegretta
|
|
|
|
@page
|
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
This manual documents the GNU @command{nano} editor.
|
|
|
|
@sp 1
|
2017-07-14 10:44:59 +02:00
|
|
|
This manual is part of the GNU @command{nano} distribution.@*
|
2017-07-14 13:14:44 +02:00
|
|
|
|
2014-01-03 02:11:04 +00:00
|
|
|
@sp 4
|
2020-01-15 11:42:38 +01:00
|
|
|
Copyright @copyright{} 1999-2009, 2014-2020 Free Software Foundation, Inc.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@sp 1
|
2007-08-23 04:34:35 +00:00
|
|
|
This document is dual-licensed. You may distribute and/or modify it
|
|
|
|
under the terms of either of the following licenses:
|
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@sp 1
|
2007-08-23 04:34:35 +00:00
|
|
|
* 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
|
2018-11-11 12:28:40 +01:00
|
|
|
with this program. If not, see @url{https://www.gnu.org/licenses/}.
|
2007-08-23 04:34:35 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@sp 1
|
2007-08-23 04:34:35 +00: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
|
2018-11-11 12:28:40 +01:00
|
|
|
along with this program. If not, see @url{https://www.gnu.org/licenses/}.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@sp 1
|
2002-11-04 16:05:42 +00:00
|
|
|
You may contact the author by
|
2001-02-12 03:48:53 +00:00
|
|
|
e-mail: @email{chrisa@@asty.org}@*
|
|
|
|
@end titlepage
|
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@ifnottex
|
|
|
|
|
2019-10-14 10:21:02 +02:00
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
@node Top
|
|
|
|
@top
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2019-12-22 15:34:04 +01:00
|
|
|
This manual documents the GNU @command{nano} editor, version 4.7.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
|
|
|
@menu
|
|
|
|
* Introduction::
|
2015-06-07 10:02:31 +00:00
|
|
|
* Invoking::
|
|
|
|
* Command-line Options::
|
2001-02-12 03:48:53 +00:00
|
|
|
* Editor Basics::
|
2015-04-05 09:14:13 +00:00
|
|
|
* Built-in Help::
|
2001-02-12 03:48:53 +00:00
|
|
|
* Feature Toggles::
|
2006-04-27 18:52:50 +00:00
|
|
|
* Nanorc Files::
|
2001-02-12 03:48:53 +00:00
|
|
|
* The File Browser::
|
|
|
|
* Pico Compatibility::
|
|
|
|
* Building and Configure Options::
|
|
|
|
@end menu
|
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@end ifnottex
|
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
|
|
|
|
@node Introduction
|
2001-02-12 03:48:53 +00:00
|
|
|
@chapter Introduction
|
|
|
|
|
2019-01-23 19:13:23 +01:00
|
|
|
GNU @command{nano} is a small and friendly text editor. Besides
|
|
|
|
basic text editing, @command{nano} offers features like undo/redo,
|
|
|
|
syntax coloring, interactive search-and-replace, auto-indentation,
|
|
|
|
line numbers, word completion, file locking, backup files, and
|
|
|
|
internationalization support.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
The original goal for @command{nano} was to be a complete bug-for-bug
|
2015-06-07 10:02:31 +00:00
|
|
|
emulation of Pico. But currently the goal is to be as compatible
|
2019-01-22 21:20:46 +01:00
|
|
|
as is reasonable while offering a superset of Pico's functionality.
|
2017-07-14 10:44:59 +02:00
|
|
|
@xref{Pico Compatibility} for more details on how @command{nano} and
|
2017-06-08 16:25:23 +02:00
|
|
|
Pico differ.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2019-03-18 20:01:11 +01:00
|
|
|
Starting with version 4.0, @command{nano} no longer hard-wraps an overlong
|
2019-06-05 19:40:15 +02:00
|
|
|
line by default. It further uses smooth scrolling by default, and by
|
|
|
|
default includes the line below the title bar into the editing area.
|
2019-03-18 20:01:11 +01:00
|
|
|
|
2019-03-24 10:54:46 +01:00
|
|
|
If you want the old, Pico behavior back, you can use the
|
2019-04-07 09:40:35 +02:00
|
|
|
following options: @option{--breaklonglines},
|
2019-03-24 10:54:46 +01:00
|
|
|
@option{--jumpyscrolling}, and @option{--emptyline}
|
2019-04-07 09:40:35 +02:00
|
|
|
(or @option{-bje} for short).
|
2019-03-18 20:01:11 +01:00
|
|
|
|
2015-06-07 16:45:09 +00:00
|
|
|
Please report bugs via @url{https://savannah.gnu.org/bugs/?group=nano}.
|
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
|
2015-06-07 10:02:31 +00:00
|
|
|
@node Invoking
|
|
|
|
@chapter Invoking
|
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
The usual way to invoke @command{nano} is:
|
2006-05-01 13:43:02 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@iftex
|
|
|
|
@sp 1
|
|
|
|
@end iftex
|
|
|
|
@example
|
2015-04-05 09:14:13 +00:00
|
|
|
@code{nano [FILE]}
|
2017-07-14 13:14:44 +02:00
|
|
|
@end example
|
|
|
|
@iftex
|
|
|
|
@sp 1
|
|
|
|
@end iftex
|
2006-05-01 13:43:02 +00:00
|
|
|
|
2017-02-12 12:06:44 +01:00
|
|
|
But it is also possible to specify one or more options (see the next
|
|
|
|
section), and to edit several files in a row. Additionally, the cursor
|
|
|
|
can be put on a specific line of a file by adding the line number
|
2015-04-05 09:14:13 +00:00
|
|
|
with a plus sign before the filename, and even in a specific column by
|
2019-08-20 19:12:57 +02:00
|
|
|
adding it with a comma.
|
2019-12-02 17:00:35 +01:00
|
|
|
(Negative numbers count from the end of the file or line.)
|
2019-08-20 19:12:57 +02:00
|
|
|
The cursor can also be put on the first or last occurrence of a specific string
|
|
|
|
by specifying that string after @code{+/} or @code{+?} before the filename.
|
|
|
|
The string can be made case sensitive and/or caused to be interpreted as a
|
|
|
|
regular expression by inserting a @code{c} and/or @code{r} after the plus sign.
|
|
|
|
These search modes can be explicitly disabled by using the uppercase variant
|
|
|
|
of those letters: @code{C} and/or @code{R}. When the string contains spaces,
|
|
|
|
it needs to be enclosed in quotes.
|
|
|
|
A more complete command synopsis thus is:
|
2006-05-01 13:43:02 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
@iftex
|
|
|
|
@sp 1
|
|
|
|
@end iftex
|
|
|
|
@example
|
2019-08-20 19:12:57 +02:00
|
|
|
@code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+[crCR](/|?)STRING] FILE]@dots{}}
|
2017-07-14 13:14:44 +02:00
|
|
|
@end example
|
|
|
|
@iftex
|
|
|
|
@sp 1
|
|
|
|
@end iftex
|
2006-05-01 13:43:02 +00:00
|
|
|
|
2017-11-17 21:40:54 +01:00
|
|
|
Normally, however, you set your preferred options in a @file{nanorc}
|
2017-06-08 16:25:23 +02:00
|
|
|
file (@pxref{Nanorc Files}). And when using @code{set positionlog}
|
2017-07-14 10:44:59 +02:00
|
|
|
(making @command{nano} remember the cursor position when you close a file),
|
2015-07-15 19:50:55 +00:00
|
|
|
you will rarely need to specify a line number.
|
2015-04-05 09:14:13 +00:00
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
As a special case: when instead of a filename a dash is given, @command{nano}
|
2017-06-29 20:56:58 +02:00
|
|
|
will read data from standard input. This means you can pipe the output of
|
|
|
|
a command straight into a buffer, and then edit it.
|
2016-02-05 11:55:55 +00:00
|
|
|
|
2019-10-14 10:21:02 +02:00
|
|
|
|
2015-06-07 10:02:31 +00:00
|
|
|
@node Command-line Options
|
|
|
|
@chapter Command-line Options
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@command{nano} takes the following options from the command line:
|
2002-06-28 22:45:14 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@table @option
|
2015-06-07 16:45:09 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -A
|
|
|
|
@itemx --smarthome
|
2004-05-22 20:15:20 +00:00
|
|
|
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.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -B
|
|
|
|
@itemx --backup
|
2015-06-07 18:45:34 +00:00
|
|
|
When saving a file, back up the previous version of it, using the current
|
2015-08-06 19:42:08 +00:00
|
|
|
filename suffixed with a tilde (@code{~}).
|
2002-06-28 22:45:14 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -C @var{directory}
|
|
|
|
@itemx --backupdir=@var{directory}
|
2015-06-07 18:45:34 +00:00
|
|
|
Make and keep not just one backup file, but make and keep a uniquely
|
|
|
|
numbered one every time a file is saved --- when backups are enabled.
|
|
|
|
The uniquely numbered files are stored in the specified directory.
|
2004-02-28 16:24:31 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -D
|
|
|
|
@itemx --boldtext
|
2006-04-12 15:27:40 +00:00
|
|
|
Use bold text instead of reverse video text.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -E
|
|
|
|
@itemx --tabstospaces
|
2005-06-15 23:20:56 +00:00
|
|
|
Convert typed tabs to spaces.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -F
|
|
|
|
@itemx --multibuffer
|
2015-04-18 16:07:53 +00:00
|
|
|
Read a file into a new buffer by default.
|
2001-10-03 12:45:22 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -G
|
|
|
|
@itemx --locking
|
2014-05-06 20:43:00 +00:00
|
|
|
Enable vim-style file locking when editing files.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -H
|
|
|
|
@itemx --historylog
|
2017-11-17 21:40:54 +01:00
|
|
|
Save the last hundred search strings and replacement strings and
|
|
|
|
executed commands, so they can be easily reused in later sessions.
|
2006-05-14 15:19:38 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -I
|
|
|
|
@itemx --ignorercfiles
|
2017-11-17 21:40:54 +01:00
|
|
|
Don't look at the system's nanorc file nor at the user's nanorc.
|
2002-07-20 13:57:41 +00:00
|
|
|
|
2019-03-03 11:38:53 +01:00
|
|
|
@item -J
|
|
|
|
@itemx --guidestripe
|
|
|
|
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 @code{set stripecolor}
|
|
|
|
in your nanorc file.)
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -K
|
2018-12-23 19:45:34 +01:00
|
|
|
@itemx --rawsequences
|
2018-12-28 19:20:40 +01:00
|
|
|
Interpret escape sequences directly (instead of asking @code{ncurses} to
|
|
|
|
translate them). If you need this option to get your keyboard to work
|
|
|
|
properly, please report a bug. Using this option disables @command{nano}'s
|
|
|
|
mouse support.
|
2005-08-10 23:32:08 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -L
|
|
|
|
@itemx --nonewlines
|
2019-06-04 19:54:58 +02: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 17:35:44 +00:00
|
|
|
|
2018-01-23 13:44:03 +01:00
|
|
|
@item -M
|
|
|
|
@itemx --trimblanks
|
|
|
|
Snip trailing whitespace from the wrapped line when automatic
|
|
|
|
hard-wrapping occurs or when text is justified.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -N
|
|
|
|
@itemx --noconvert
|
2014-05-06 20:43:00 +00:00
|
|
|
Disable automatic conversion of files from DOS/Mac format.
|
2002-03-04 17:35:44 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -O
|
|
|
|
@itemx --morespace
|
2019-01-30 21:01:53 +01:00
|
|
|
Obsolete and ignored option, since the line below the title bar is included
|
|
|
|
into the editing space by default. If you prefer to keep this line blank,
|
|
|
|
use @option{-e} or @option{--emptyline}.
|
2006-07-30 23:18:15 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -P
|
2015-07-15 19:50:55 +00:00
|
|
|
@itemx --positionlog
|
2016-01-25 20:51:00 +00: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.
|
2014-04-08 20:01:17 +00:00
|
|
|
|
2018-05-22 18:25:59 +02:00
|
|
|
@item -Q "@var{regex}"
|
|
|
|
@itemx --quotestr="@var{regex}"
|
2019-01-23 19:57:17 +01:00
|
|
|
Set the regular expression for matching the quoting part of a line.
|
2019-06-08 17:07:34 +02:00
|
|
|
The default value is @t{"^([@w{ }\t]*([!#%:;>|@}]|//))+"}.
|
2019-01-23 19:57:17 +01:00
|
|
|
(Note that @code{\t} stands for a literal Tab character.)
|
|
|
|
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 17:35:44 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -R
|
|
|
|
@itemx --restricted
|
2006-05-01 13:22:47 +00:00
|
|
|
Restricted mode: don't read or write to any file not specified on the
|
2018-09-30 13:36:45 +02:00
|
|
|
command line. This means: don't read or write history files; don't allow
|
|
|
|
suspending; don't allow spell checking; don't
|
2014-05-06 20:43:00 +00:00
|
|
|
allow a file to be appended to, prepended to, or saved under a different
|
2018-09-30 13:36:45 +02:00
|
|
|
name if it already has one; and don't make backup files.
|
|
|
|
Restricted mode can also be activated by invoking @command{nano} with
|
2015-08-06 19:42:08 +00:00
|
|
|
any name beginning with @code{r} (e.g.@: @command{rnano}).
|
2005-06-17 22:53:41 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -S
|
|
|
|
@itemx --smooth
|
2019-01-30 21:01:53 +01:00
|
|
|
Obsolete and ignored option, since smooth scrolling has become the default.
|
|
|
|
If you prefer the chunk-by-chunk scrolling behavior,
|
|
|
|
use @option{-j} or @option{--jumpyscrolling}.
|
2001-10-03 12:45:22 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -T @var{number}
|
|
|
|
@itemx --tabsize=@var{number}
|
|
|
|
Set the displayed tab length to @var{number} columns. The value of
|
2015-08-06 19:42:08 +00:00
|
|
|
@var{number} must be greater than 0. The default value is @t{8}.
|
2001-10-03 12:45:22 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -U
|
|
|
|
@itemx --quickblank
|
2017-06-18 19:53:18 +02:00
|
|
|
Do quick status-bar blanking: status-bar messages will disappear after 1
|
2015-08-06 19:42:08 +00:00
|
|
|
keystroke instead of 25. Note that option @option{-c}
|
|
|
|
(@option{--constantshow}) overrides this.
|
2005-06-17 22:11:43 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -V
|
|
|
|
@itemx --version
|
2006-05-01 13:22:47 +00:00
|
|
|
Show the current version number and exit.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -W
|
|
|
|
@itemx --wordbounds
|
2016-06-30 18:02:45 +02:00
|
|
|
Detect word boundaries differently by treating punctuation
|
2006-06-26 04:39:31 +00:00
|
|
|
characters as parts of words.
|
2005-08-10 23:32:08 +00:00
|
|
|
|
2016-06-30 18:02:45 +02:00
|
|
|
@item -X "@var{characters}"
|
|
|
|
@itemx --wordchars="@var{characters}"
|
|
|
|
Specify which other characters (besides the normal alphanumeric ones)
|
|
|
|
should be considered as parts of words. This overrides option
|
|
|
|
@option{-W} (@option{--wordbounds}).
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -Y @var{name}
|
|
|
|
@itemx --syntax=@var{name}
|
2017-06-08 16:25:23 +02:00
|
|
|
Specify the syntax to be used for highlighting.
|
|
|
|
@xref{Syntax Highlighting} for more info.
|
2002-06-28 22:45:14 +00:00
|
|
|
|
2018-10-24 03:02:08 -06:00
|
|
|
@item -Z
|
|
|
|
@itemx --zap
|
|
|
|
Let an unmodified @key{Backspace} or @key{Delete} erase the marked region
|
|
|
|
(instead of a single character, and without affecting the cutbuffer).
|
|
|
|
|
2017-06-28 16:57:46 +02:00
|
|
|
@item -a
|
|
|
|
@itemx --atblanks
|
|
|
|
When doing soft line wrapping, wrap lines at whitespace
|
|
|
|
instead of always at the edge of the screen.
|
|
|
|
|
2019-01-28 20:43:02 +01:00
|
|
|
@item -b
|
|
|
|
@itemx --breaklonglines
|
|
|
|
Automatically hard-wrap the current line when it becomes overlong.
|
|
|
|
(This option is the opposite of @option{-w} (@option{--nowrap}) ---
|
|
|
|
the last one given takes effect.)
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -c
|
2015-07-15 19:40:37 +00:00
|
|
|
@itemx --constantshow
|
2017-06-18 19:53:18 +02:00
|
|
|
Constantly display the cursor position (line number, column number,
|
|
|
|
and character number) on the status bar.
|
2015-08-06 19:42:08 +00:00
|
|
|
Note that this overrides option @option{-U} (@option{--quickblank}).
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -d
|
|
|
|
@itemx --rebinddelete
|
2018-12-28 19:37:02 +01: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 16:44:10 +00:00
|
|
|
|
2019-01-28 20:43:02 +01:00
|
|
|
@item -e
|
|
|
|
@itemx --emptyline
|
|
|
|
Do not use the line below the title bar, leaving it entirely blank.
|
|
|
|
|
2020-01-19 12:50:42 +01:00
|
|
|
@item -f @var{file}
|
|
|
|
@itemx --rcfile=@var{file}
|
|
|
|
Read only this @var{file} for setting nano's options, instead of reading
|
|
|
|
both the system-wide and the user's nanorc files.
|
|
|
|
|
2016-10-23 12:56:47 +02:00
|
|
|
@item -g
|
|
|
|
@itemx --showcursor
|
2018-10-07 10:38:11 +02: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 12:56:47 +02:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -h
|
|
|
|
@itemx --help
|
2014-05-06 13:27:41 +00:00
|
|
|
Show a summary of command-line options and exit.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -i
|
|
|
|
@itemx --autoindent
|
2018-05-30 10:19:57 +02: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).
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2019-01-28 20:43:02 +01:00
|
|
|
@item -j
|
|
|
|
@itemx --jumpyscrolling
|
|
|
|
Scroll the buffer contents per half-screen instead of per line.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -k
|
2017-07-14 16:06:52 +02:00
|
|
|
@itemx --cutfromcursor
|
2017-07-13 22:17:29 +02:00
|
|
|
Make the 'Cut Text' command (normally @kbd{^K}) cut from the current cursor
|
2014-05-06 20:43:00 +00:00
|
|
|
position to the end of the line, instead of cutting the entire line.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2016-10-22 13:56:43 +02:00
|
|
|
@item -l
|
|
|
|
@itemx --linenumbers
|
|
|
|
Display line numbers to the left of the text area.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -m
|
|
|
|
@itemx --mouse
|
2006-05-24 20:55:44 +00: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
|
|
|
|
click), and execute shortcuts. The mouse will work in the X Window
|
2014-05-06 20:43:00 +00:00
|
|
|
System, and on the console when gpm is running. Text can still be
|
|
|
|
selected through dragging by holding down the Shift key.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -n
|
|
|
|
@itemx --noread
|
2014-04-08 19:40:37 +00:00
|
|
|
Treat any name given on the command line as a new file. This allows
|
2014-08-02 20:47:35 +00:00
|
|
|
@command{nano} to write to named pipes: it will start with a blank buffer,
|
2014-04-08 19:40:37 +00:00
|
|
|
and will write to the pipe when the user saves the "file". This way
|
2014-08-02 20:47:35 +00:00
|
|
|
@command{nano} can be used as an editor in combination with for instance
|
|
|
|
@command{gpg} without having to write sensitive data to disk first.
|
2014-04-08 19:40:37 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -o @var{directory}
|
|
|
|
@itemx --operatingdir=@var{directory}
|
|
|
|
Set the operating directory. This makes @command{nano} set up something
|
|
|
|
similar to a chroot.
|
2001-10-03 12:45:22 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -p
|
|
|
|
@itemx --preserve
|
2017-07-13 22:17:29 +02:00
|
|
|
Preserve the @kbd{^Q} (XON) and @kbd{^S} (XOFF) sequences so data being
|
|
|
|
sent to the editor can be stopped and started.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -r @var{number}
|
|
|
|
@itemx --fill=@var{number}
|
2019-01-26 10:44:03 +01:00
|
|
|
Set the target width for justifying and automatic hard-wrapping at this
|
|
|
|
@var{number} of columns. If the value is 0 or less, wrapping will occur
|
|
|
|
at the width of the screen minus @var{number} columns, allowing the wrap
|
|
|
|
point to vary along with the width of the screen if the screen is resized.
|
|
|
|
The default value is @t{-8}.
|
2014-08-02 20:47:35 +00:00
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
@anchor{@option{--speller}}
|
2019-08-16 18:46:34 +02:00
|
|
|
@item -s "@var{program} [@var{arg} @dots{}]"
|
|
|
|
@itemx --speller="@var{program} [@var{arg} @dots{}]"
|
2017-07-13 17:30:23 +02:00
|
|
|
Use the given program to do spell checking and correcting. By default,
|
|
|
|
@command{nano} uses the command specified in the @env{SPELL} environment
|
2018-05-30 19:57:28 +02:00
|
|
|
variable. If @env{SPELL} is not set, and @option{--speller} is
|
2017-07-13 17:30:23 +02:00
|
|
|
not specified either, then @command{nano} uses its own interactive spell
|
2019-11-25 17:38:50 +01:00
|
|
|
corrector, which requires either @command{hunspell} or GNU @command{spell}
|
|
|
|
to be installed.
|
2014-08-02 20:47:35 +00:00
|
|
|
|
|
|
|
@item -t
|
|
|
|
@itemx --tempfile
|
2017-07-13 22:17:29 +02:00
|
|
|
Don't ask whether to save a modified buffer when exiting with @kbd{^X}, but
|
2016-10-22 22:07:02 +02:00
|
|
|
assume yes. This option is useful when @command{nano} is used as the
|
2001-02-12 03:48:53 +00:00
|
|
|
composer of a mailer program.
|
|
|
|
|
2015-08-04 18:49:57 +00:00
|
|
|
@item -u
|
|
|
|
@item --unix
|
|
|
|
Save a file by default in Unix format. This overrides nano's
|
2015-08-06 19:42:08 +00:00
|
|
|
default behavior of saving a file in the format that it had.
|
2017-07-14 10:44:59 +02:00
|
|
|
(This option has no effect when you also use @option{--noconvert}.)
|
2015-08-04 18:49:57 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -v
|
|
|
|
@itemx --view
|
2018-10-23 19:26:45 +02:00
|
|
|
Don't allow the contents of the file to be altered: read-only mode.
|
|
|
|
This mode allows the user to open also other files for viewing,
|
|
|
|
unless @option{--restricted} is given too.
|
|
|
|
(Note that this option should NOT be used in place of correct
|
|
|
|
file permissions to implement a read-only file.)
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -w
|
|
|
|
@itemx --nowrap
|
2019-01-26 10:44:03 +01:00
|
|
|
Do not automatically hard-wrap the current line when it becomes overlong.
|
2019-04-14 08:49:25 +02:00
|
|
|
This is the default. (This option is the opposite of @option{-b}
|
|
|
|
(@option{--breaklonglines}) --- the last one given takes effect.)
|
|
|
|
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2006-05-14 15:19:38 +00:00
|
|
|
@anchor{Expert Mode}
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -x
|
|
|
|
@itemx --nohelp
|
2016-02-05 11:55:55 +00:00
|
|
|
Expert Mode: don't show the Shortcut List at the bottom of the screen.
|
2017-06-18 19:53:18 +02:00
|
|
|
This affects the location of the status bar as well, as in Expert Mode it
|
2006-05-14 15:19:38 +00:00
|
|
|
is located at the very bottom of the editor.
|
|
|
|
|
|
|
|
Note: When accessing the help system, Expert Mode is temporarily
|
2014-05-06 20:43:00 +00:00
|
|
|
disabled to display the help-system navigation keys.
|
2006-05-14 15:19:38 +00:00
|
|
|
|
2018-04-30 23:10:27 +03:00
|
|
|
@item -y
|
|
|
|
@itemx --afterends
|
|
|
|
Make Ctrl+Right stop at word ends instead of beginnings.
|
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -z
|
|
|
|
@itemx --suspend
|
|
|
|
Enable the ability to suspend @command{nano} using the system's suspend
|
2017-07-13 22:17:29 +02:00
|
|
|
keystroke (usually @kbd{^Z}).
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-08-02 20:47:35 +00:00
|
|
|
@item -$
|
|
|
|
@itemx --softwrap
|
|
|
|
Enable 'soft wrapping'. This will make @command{nano} attempt to display the
|
2014-04-23 20:42:55 +00:00
|
|
|
entire contents of any line, even if it is longer than the screen width, by
|
|
|
|
continuing it over multiple screen lines. Since
|
2015-08-06 19:42:08 +00:00
|
|
|
@code{$} normally refers to a variable in the Unix shell, you should specify
|
|
|
|
this option last when using other options (e.g.@: @code{nano -wS$}) or pass it
|
|
|
|
separately (e.g.@: @code{nano -wS -$}).
|
2009-12-02 03:36:22 +00:00
|
|
|
|
2001-02-12 03:48:53 +00:00
|
|
|
@end table
|
|
|
|
|
2006-05-24 20:55:44 +00:00
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
@node Editor Basics
|
2001-02-12 03:48:53 +00:00
|
|
|
@chapter Editor Basics
|
2014-05-06 09:58:23 +00:00
|
|
|
|
2001-02-12 03:48:53 +00:00
|
|
|
@menu
|
|
|
|
* Entering Text::
|
2016-02-05 11:55:55 +00:00
|
|
|
* Commands::
|
2014-05-06 13:27:41 +00:00
|
|
|
* The Cutbuffer::
|
|
|
|
* The Mark::
|
2016-02-05 11:55:55 +00:00
|
|
|
* Screen Layout::
|
|
|
|
* Search and Replace::
|
2006-05-24 20:55:44 +00:00
|
|
|
* Using the Mouse::
|
2017-11-13 21:08:36 +01:00
|
|
|
* Limitations::
|
2001-02-12 03:48:53 +00:00
|
|
|
@end menu
|
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
@node Entering Text
|
2001-02-12 03:48:53 +00:00
|
|
|
@section Entering Text
|
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
@command{nano} is a "modeless" editor. This means that all keystrokes,
|
2016-02-05 11:55:55 +00:00
|
|
|
with the exception of Control and Meta sequences, enter text into the
|
|
|
|
file being edited.
|
|
|
|
|
|
|
|
Characters not present on the keyboard can be entered in two ways:
|
|
|
|
|
|
|
|
@itemize @bullet
|
|
|
|
@item
|
|
|
|
For characters with a single-byte code,
|
|
|
|
pressing the Esc key twice and then typing a three-digit decimal number
|
2017-07-14 13:14:44 +02:00
|
|
|
(from @kbd{000} to @kbd{255}) will make @command{nano} behave as if you
|
|
|
|
typed the key with that value.
|
2016-02-05 11:55:55 +00:00
|
|
|
|
|
|
|
@item
|
2017-07-13 22:17:29 +02:00
|
|
|
For any possible character, pressing @kbd{M-V} (Alt+V) and then typing a
|
2017-07-14 13:14:44 +02:00
|
|
|
six-digit hexadecimal number (starting with @kbd{0} or @kbd{1}) will enter the
|
2016-12-28 11:54:49 +01:00
|
|
|
corresponding Unicode character into the buffer.
|
2016-02-05 11:55:55 +00:00
|
|
|
@end itemize
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-13 22:17:29 +02:00
|
|
|
For example, typing @kbd{Esc Esc 2 3 4} will enter the character "ê" ---
|
|
|
|
useful when writing about a French party. Typing @kbd{M-V 0 0 2 2 c 4}
|
2017-07-03 17:35:50 +02:00
|
|
|
will enter the symbol "⋄", a little diamond.
|
2016-12-28 11:54:49 +01:00
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
@node Commands
|
|
|
|
@section Commands
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-14 13:14:44 +02:00
|
|
|
Commands are given by using the Control key (Ctrl, shown as @kbd{^})
|
|
|
|
or the Meta key (Alt or Cmd, shown as @kbd{M-}).
|
2003-08-31 16:44:10 +00:00
|
|
|
|
2001-02-12 03:48:53 +00:00
|
|
|
@itemize @bullet
|
|
|
|
@item
|
2016-02-05 11:55:55 +00:00
|
|
|
A control-key sequence is entered by holding down the Ctrl key and
|
2014-05-06 13:27:41 +00:00
|
|
|
pressing the desired key.
|
2016-02-05 11:55:55 +00:00
|
|
|
|
2003-08-31 16:44:10 +00:00
|
|
|
@item
|
2016-02-05 11:55:55 +00:00
|
|
|
A meta-key sequence is entered by holding down the Meta key (normally
|
|
|
|
the Alt key) and pressing the desired key.
|
2001-02-12 03:48:53 +00:00
|
|
|
@end itemize
|
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
If for some reason on your system the combinations with Ctrl or Alt do
|
|
|
|
not work, you can generate them by using the Esc key. A control-key
|
|
|
|
sequence is generated by pressing the Esc key twice and then pressing
|
|
|
|
the desired key, and a meta-key sequence by pressing the Esc key once
|
|
|
|
and then pressing the desired key.
|
|
|
|
|
2014-05-06 13:27:41 +00:00
|
|
|
@node The Cutbuffer
|
|
|
|
@section The Cutbuffer
|
|
|
|
|
|
|
|
Text can be cut from a file, a whole line at a time, by using the 'Cut Text'
|
2017-07-13 22:17:29 +02:00
|
|
|
command (default key binding: @kbd{^K}). The cut line is stored in
|
|
|
|
the cutbuffer. Consecutive strokes of @kbd{^K} will add each cut line
|
|
|
|
to this buffer, but a @kbd{^K}
|
2014-05-06 13:27:41 +00:00
|
|
|
after any other keystroke will overwrite the entire cutbuffer.
|
|
|
|
|
|
|
|
The contents of the cutbuffer can be pasted back into the file with the
|
2017-07-13 22:17:29 +02:00
|
|
|
'Uncut Text' command (default key binding: @kbd{^U}).
|
2014-05-06 13:27:41 +00:00
|
|
|
|
|
|
|
A line of text can be copied into the cutbuffer (without cutting it) with
|
2017-07-13 22:17:29 +02:00
|
|
|
the 'Copy Text' command (default key binding: @kbd{M-6}).
|
2014-05-06 13:27:41 +00:00
|
|
|
|
|
|
|
@node The Mark
|
|
|
|
@section The Mark
|
|
|
|
|
|
|
|
Text can be selected by first 'setting the Mark' (default key bindings:
|
2017-07-13 22:17:29 +02:00
|
|
|
@kbd{^6} and @kbd{M-A}) and then moving the cursor to the other end of the portion
|
2018-02-27 09:48:46 +01:00
|
|
|
to be selected. The selected portion of text will be highlighted.
|
2014-05-06 13:27:41 +00:00
|
|
|
This selection can now be cut or copied in its entirety with a single
|
2017-07-13 22:17:29 +02:00
|
|
|
@kbd{^K} or @kbd{M-6}. Or the selection can be used to limit the scope of
|
|
|
|
a search-and-replace (@kbd{^\}) or spell-checking session (@kbd{^T}).
|
2014-05-06 13:27:41 +00:00
|
|
|
|
2018-07-10 15:52:03 +02:00
|
|
|
On some terminals, text can be selected also by holding down @kbd{Shift}
|
|
|
|
while using the cursor keys. Holding down the @kbd{Ctrl} or @kbd{Alt}
|
|
|
|
key too will increase the stride. Such a selection is cancelled
|
2018-02-27 09:48:46 +01:00
|
|
|
upon any cursor movement where @kbd{Shift} isn't held.
|
|
|
|
|
2014-05-06 13:27:41 +00:00
|
|
|
Cutting or copying selected text will toggle the mark off automatically.
|
2017-07-13 22:17:29 +02:00
|
|
|
If necessary, it can be toggled off manually with another @kbd{^6} or @kbd{M-A}.
|
2014-05-06 13:27:41 +00:00
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
@node Screen Layout
|
|
|
|
@section Screen Layout
|
|
|
|
|
|
|
|
The default screen of nano consists of five areas. From top to bottom
|
2017-06-18 19:53:18 +02:00
|
|
|
these are: the title bar, a blank line, the edit window, the status bar,
|
2016-02-05 11:55:55 +00:00
|
|
|
and two help lines.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-06-18 19:53:18 +02:00
|
|
|
The title bar consists of
|
2003-08-31 16:44:10 +00:00
|
|
|
three sections: left, center and right. The section on the left
|
2017-07-14 10:44:59 +02:00
|
|
|
displays the version of @command{nano} being used. The center section
|
2006-05-21 21:32:13 +00:00
|
|
|
displays the current filename, or "New Buffer" if the file has not yet
|
2016-02-05 11:55:55 +00:00
|
|
|
been named. The section on the right displays "Modified" if the
|
2006-04-20 14:33:36 +00:00
|
|
|
file has been modified since it was last saved or opened.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-06-18 19:53:18 +02:00
|
|
|
The status bar is the third line from the bottom of the screen. It
|
2006-05-01 13:22:47 +00:00
|
|
|
shows important and informational messages. Any error messages that
|
2017-06-18 19:53:18 +02:00
|
|
|
occur from using the editor will appear on the status bar. Any questions
|
|
|
|
that are asked of the user will be asked on the status bar, and any user
|
|
|
|
input (search strings, filenames, etc.) will be input on the status bar.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
The two help lines at the bottom of the screen show some of the most
|
|
|
|
essential functions of the editor. These two lines are called the
|
|
|
|
Shortcut List.
|
|
|
|
|
|
|
|
@node Search and Replace
|
|
|
|
@section Search and Replace
|
|
|
|
|
|
|
|
One can search the current buffer for the occurrence of any string
|
2017-07-13 22:17:29 +02:00
|
|
|
with the Search command (default key binding: @kbd{^W}). The default search
|
2016-02-05 11:55:55 +00:00
|
|
|
mode is forward, case-insensitive, and for literal strings. But one
|
2017-07-13 22:17:29 +02:00
|
|
|
can search backwards by pressing @kbd{M-B}, search case sensitively with @kbd{M-C},
|
|
|
|
and interpret regular expressions in the search string with @kbd{M-R}.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2016-02-05 11:55:55 +00:00
|
|
|
A regular expression in a search string always covers just one line;
|
2017-07-13 22:17:29 +02:00
|
|
|
it cannot span multiple lines. And when replacing (with @kbd{^\} or @kbd{M-R})
|
2016-02-05 11:55:55 +00:00
|
|
|
the replacement string cannot contain a newline (LF).
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
@node Using the Mouse
|
2006-05-24 20:55:44 +00:00
|
|
|
@section Using the Mouse
|
|
|
|
|
|
|
|
When mouse support has been configured and enabled, a single mouse click
|
|
|
|
places the cursor at the indicated position. Clicking a second time in
|
|
|
|
the same position toggles the mark. Clicking in the shortcut list
|
2014-03-26 13:12:52 +00:00
|
|
|
executes the selected shortcut. To be able to select text with the
|
|
|
|
left button, or paste text with the middle button, hold down the
|
|
|
|
Shift key during those actions.
|
2006-05-24 20:55:44 +00:00
|
|
|
|
|
|
|
The mouse will work in the X Window System, and on the console when gpm
|
|
|
|
is running.
|
|
|
|
|
2017-11-13 21:08:36 +01:00
|
|
|
@node Limitations
|
|
|
|
@section Limitations
|
2015-12-03 09:34:10 +00:00
|
|
|
|
2017-11-13 21:08:36 +01:00
|
|
|
The recording and playback of keyboard macros works correctly only on a
|
2018-03-28 19:34:26 +02:00
|
|
|
terminal emulator, not on a Linux console (VT), because the latter does
|
|
|
|
not by default distinguish modified from unmodified arrow keys.
|
2006-05-24 20:55:44 +00:00
|
|
|
|
2019-10-14 10:21:02 +02:00
|
|
|
|
2015-04-05 09:14:13 +00:00
|
|
|
@node Built-in Help
|
|
|
|
@chapter Built-in Help
|
2001-02-12 03:48:53 +00:00
|
|
|
|
2017-07-14 10:44:59 +02:00
|
|
|
The built-in help system in @command{nano} is available by pressing @kbd{^G}.
|
2015-04-05 09:14:13 +00:00
|
|
|
It is fairly self-explanatory. It documents the various parts of the
|
2017-07-13 22:17:29 +02:00
|
|
|
editor and the available keystrokes. Navigation is via the @kbd{^Y} (Page Up)
|
|
|
|
and @kbd{^V} (Page Down) keys. @kbd{^X} exits from the help system.
|
2001-02-12 03:48:53 +00:00
|
|
|
|
|
|
|
|
2014-05-06 09:58:23 +00:00
|
|
|
@node Feature Toggles
|
2001-02-12 03:48:53 +00:00
|
|
|
@chapter Feature Toggles
|
|
|
|