2019-03-11 08:27:19 +01:00
|
|
|
.\" Copyright (C) 2003-2011, 2013-2019 Free Software Foundation, Inc.
|
2003-02-09 01:28:40 +00:00
|
|
|
.\"
|
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:
|
|
|
|
.\"
|
|
|
|
.\" * 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 12:28:40 +01:00
|
|
|
.\" <https://www.gnu.org/licenses/>.
|
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 along with this program. If not, see
|
2018-11-11 12:28:40 +01:00
|
|
|
.\" <https://www.gnu.org/licenses/>.
|
2003-02-09 01:28:40 +00:00
|
|
|
.\"
|
2019-10-03 14:21:09 +02:00
|
|
|
.TH NANORC 5 "version 4.5" "October 2019"
|
2016-10-22 22:07:02 +02:00
|
|
|
|
2003-02-09 01:28:40 +00:00
|
|
|
.SH NAME
|
2016-10-22 22:07:02 +02:00
|
|
|
nanorc \- GNU nano's configuration file
|
|
|
|
|
2019-03-25 15:22:30 +01:00
|
|
|
.SH NOTICE
|
2019-03-18 20:01:11 +01:00
|
|
|
Starting with version 4.0, \fBnano\fR 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
|
|
|
.sp
|
2019-03-24 10:54:46 +01:00
|
|
|
If you want the old, Pico behavior back, you can use \fBset breaklonglines\fR,
|
2019-04-07 09:40:35 +02:00
|
|
|
\fBset jumpyscrolling\fR, and \fBset emptyline\fR.
|
2019-03-18 20:01:11 +01:00
|
|
|
|
2003-02-09 01:28:40 +00:00
|
|
|
.SH DESCRIPTION
|
2014-05-05 19:32:42 +00:00
|
|
|
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
|
2019-03-25 15:31:47 +01:00
|
|
|
system-wide settings, from \fI/etc/nanorc\fP (the exact path might be
|
2017-11-17 21:40:54 +01:00
|
|
|
different on your system), and then the user-specific settings, either
|
2019-03-25 15:31:47 +01:00
|
|
|
from \fI~/.nanorc\fR or from \fI$XDG_CONFIG_HOME/nano/nanorc\fR
|
|
|
|
or from \fI~/.config/nano/nanorc\fR, whichever is encountered first.
|
2003-02-09 01:28:40 +00:00
|
|
|
|
|
|
|
.SH OPTIONS
|
2006-04-05 13:40:56 +00:00
|
|
|
The configuration file accepts a series of \fBset\fP and \fBunset\fP
|
|
|
|
commands, which can be used to configure nano on startup without using
|
2014-05-05 19:32:42 +00:00
|
|
|
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.
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2009-12-02 03:36:22 +00:00
|
|
|
Options in \fInanorc\fP files take precedence over nano's defaults, and
|
2014-08-03 20:57:15 +00:00
|
|
|
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
|
2017-11-17 21:40:54 +01:00
|
|
|
\fInanorc\fR file in your own \fInanorc\fR. Options that take an
|
2014-08-03 20:57:15 +00:00
|
|
|
argument cannot be unset.
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2019-06-07 11:15:02 +02:00
|
|
|
Quotes inside the \fIcharacters\fR parameters below should not be escaped.
|
|
|
|
The last double quote on the line will be seen as the closing quote.
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2003-02-09 01:28:40 +00:00
|
|
|
The supported commands and arguments are:
|
|
|
|
|
|
|
|
.TP 3
|
2018-04-30 23:10:27 +03:00
|
|
|
.B set afterends
|
|
|
|
Make Ctrl+Right stop at word ends instead of beginnings.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set allow_insecure_backup
|
2010-06-21 03:10:10 +00:00
|
|
|
When backing up files, allow the backup to succeed even if its permissions
|
2014-06-20 18:40:34 +00:00
|
|
|
can't be (re)set due to special OS considerations. You should
|
2010-06-21 03:10:10 +00:00
|
|
|
NOT enable this option unless you are sure you need it.
|
|
|
|
.TP
|
2017-03-07 10:36:43 -06:00
|
|
|
.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
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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).
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set backup
|
2015-06-07 18:45:34 +00:00
|
|
|
When saving a file, create a backup file by adding a tilde (\fB~\fP) to
|
|
|
|
the file's name.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2005-06-17 18:00:16 +00:00
|
|
|
.B set backupdir "\fIdirectory\fP"
|
2015-06-07 18:45:34 +00:00
|
|
|
Make and keep not just one backup file, but make and keep a uniquely
|
2017-07-14 15:21:30 +02:00
|
|
|
numbered one every time a file is saved -- when backups are enabled
|
2015-06-07 18:45:34 +00:00
|
|
|
with \fBset backup\fR or \fB\-\-backup\fR or \fB\-B\fR.
|
|
|
|
The uniquely numbered files are stored in the specified \fIdirectory\fR.
|
2005-06-16 18:48:30 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set boldtext
|
2017-06-18 19:53:18 +02:00
|
|
|
Use bold instead of reverse video for the title bar, status bar, key combos,
|
2017-07-29 13:24:42 -05:00
|
|
|
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.
|
2006-04-12 15:27:40 +00:00
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set brackets """ characters """
|
2006-05-23 16:23:10 +00:00
|
|
|
Set the characters treated as closing brackets when justifying
|
2014-05-06 20:43:00 +00:00
|
|
|
paragraphs. This may not include blank characters. Only closing
|
2018-06-01 15:31:32 +02:00
|
|
|
punctuation (see \fBset punct\fP), optionally followed by the specified
|
2014-05-06 20:43:00 +00:00
|
|
|
closing brackets, can end sentences. The default value is "\fB"')>]}\fP".
|
2004-02-28 16:24:31 +00:00
|
|
|
.TP
|
2019-02-19 19:05:28 +01:00
|
|
|
.B set breaklonglines
|
|
|
|
Automatically hard-wrap the current line when it becomes overlong.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set casesensitive
|
2014-05-05 19:32:42 +00:00
|
|
|
Do case-sensitive searches by default.
|
2005-06-16 18:48:30 +00:00
|
|
|
.TP
|
2015-07-15 19:40:37 +00:00
|
|
|
.B set constantshow
|
2003-02-15 13:34:03 +00:00
|
|
|
Constantly display the cursor position in the status bar.
|
2017-06-24 12:11:29 -05:00
|
|
|
This overrides the option \fBquickblank\fR.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2017-07-14 16:06:52 +02:00
|
|
|
.B set cutfromcursor
|
|
|
|
Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2019-02-19 19:05:28 +01:00
|
|
|
.B set emptyline
|
|
|
|
Do not use the line below the title bar, leaving it entirely blank.
|
|
|
|
.TP
|
2018-02-24 13:31:15 +01:00
|
|
|
.B set errorcolor \fIfgcolor\fR,\fIbgcolor\fR
|
2018-02-20 09:50:54 +01:00
|
|
|
Use this color combination for the status bar when an error message is displayed.
|
2019-06-07 11:24:51 +02:00
|
|
|
The default value is \fBbrightwhite,red\fR.
|
2018-02-20 09:50:54 +01:00
|
|
|
See \fBset titlecolor\fR for valid color names.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set fill \fInumber\fR
|
2019-01-26 10:44:03 +01:00
|
|
|
Set the target width for justifying and automatic hard-wrapping at this
|
|
|
|
\fInumber\fR of columns. If the value is 0 or less, wrapping will occur
|
|
|
|
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.
|
2019-06-07 11:24:51 +02:00
|
|
|
The default value is \fB\-8\fR.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-05-04 10:24:34 +00:00
|
|
|
.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
|
2019-04-16 10:05:35 +02:00
|
|
|
.B set 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.)
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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.
|
2003-06-29 02:25:46 +00:00
|
|
|
.TP
|
2019-02-19 19:05:28 +01:00
|
|
|
.B set jumpyscrolling
|
|
|
|
Scroll the buffer contents per half-screen instead of per line.
|
|
|
|
.TP
|
2014-05-04 10:24:34 +00:00
|
|
|
.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
|
2016-10-20 09:44:29 +01:00
|
|
|
.B set linenumbers
|
|
|
|
Display line numbers to the left of the text area.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set locking
|
2013-01-01 03:24:39 +00:00
|
|
|
Enable vim-style lock-files for when editing files.
|
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set matchbrackets """ characters """
|
2006-01-06 21:51:10 +00:00
|
|
|
Set the opening and closing brackets that can be found by bracket
|
2014-05-06 20:43:00 +00:00
|
|
|
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".
|
2006-01-06 21:51:10 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set morespace
|
2019-02-20 16:23:25 +01:00
|
|
|
Deprecated option since it has become the default setting.
|
|
|
|
When needed, use \fBunset emptyline\fR instead.
|
2005-01-17 05:24:26 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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-05 19:32:42 +00:00
|
|
|
System, and on the console when gpm is running. Text can still be
|
2014-05-06 20:43:00 +00:00
|
|
|
selected through dragging by holding down the Shift key.
|
2005-01-17 05:24:26 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set multibuffer
|
2015-04-18 16:07:53 +00:00
|
|
|
When reading in a file with ^R, insert it into a new buffer by default.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set noconvert
|
2003-02-09 01:28:40 +00:00
|
|
|
Don't convert files from DOS/Mac format.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set nohelp
|
2014-05-05 19:32:42 +00:00
|
|
|
Don't display the two help lines at the bottom of the screen.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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
|
|
|
.TP
|
2017-03-06 22:07:57 +01:00
|
|
|
.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
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set nowrap
|
2019-02-20 16:23:25 +01:00
|
|
|
Deprecated option since it has become the default setting.
|
|
|
|
When needed, use \fBunset breaklonglines\fR instead.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2016-10-20 10:07:48 +02:00
|
|
|
.B set numbercolor \fIfgcolor\fR,\fIbgcolor\fR
|
|
|
|
Specify the color combination to use for line numbers.
|
|
|
|
See \fBset titlecolor\fR for more details.
|
|
|
|
.TP
|
2005-06-17 18:00:16 +00:00
|
|
|
.B set operatingdir "\fIdirectory\fP"
|
2003-02-15 13:34:03 +00:00
|
|
|
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
2003-08-31 16:44:10 +00:00
|
|
|
subdirectories. Also, the current directory is changed to here, so
|
2011-02-24 02:14:30 +00:00
|
|
|
files are inserted from this directory. By default, the operating
|
2006-04-27 18:52:50 +00:00
|
|
|
directory feature is turned off.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2015-07-15 19:50:55 +00:00
|
|
|
.B set positionlog
|
2014-03-03 18:49:52 +00:00
|
|
|
Save the cursor position of files between editing sessions.
|
2016-01-25 20:51:00 +00:00
|
|
|
The cursor position is remembered for the 200 most-recently edited files.
|
2014-03-03 18:49:52 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set preserve
|
2003-02-09 01:28:40 +00:00
|
|
|
Preserve the XON and XOFF keys (^Q and ^S).
|
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set punct """ characters """
|
2006-05-23 16:23:10 +00:00
|
|
|
Set the characters treated as closing punctuation when justifying
|
2014-05-06 20:43:00 +00:00
|
|
|
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".
|
2004-05-29 16:38:57 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set quickblank
|
2017-06-18 19:53:18 +02:00
|
|
|
Do quick status-bar blanking: status-bar messages will disappear after 1
|
2017-06-24 12:11:29 -05:00
|
|
|
keystroke instead of 25. The option \fBconstantshow\fR overrides this.
|
2005-06-17 19:06:25 +00:00
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set quotestr """ 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 "\fB^([\ \\t]*([!#%:;>|}]|//))+\fP".
|
2019-01-23 19:57:17 +01:00
|
|
|
(Note that \fB\\t\fR stands for an actual 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.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2018-12-28 19:20:40 +01:00
|
|
|
.B set rawsequences
|
|
|
|
Interpret escape sequences directly (instead of asking \fBncurses\fR to
|
|
|
|
translate them). If you need this option to get your keyboard to work
|
|
|
|
properly, please report a bug. Using this option disables \fBnano\fR's
|
|
|
|
mouse support.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set regexp
|
2019-06-06 15:00:34 +02:00
|
|
|
Do regular-expression searches by default.
|
|
|
|
Regular expressions in \fBnano\fR are of the extended type (ERE).
|
2005-06-16 18:48:30 +00:00
|
|
|
.TP
|
2017-07-29 13:24:42 -05:00
|
|
|
.B set selectedcolor \fIfgcolor\fR,\fIbgcolor\fR
|
|
|
|
Specify the color combination to use for selected text.
|
|
|
|
See \fBset titlecolor\fR for more details.
|
|
|
|
.TP
|
2016-09-11 09:41:09 +02:00
|
|
|
.B set showcursor
|
|
|
|
Put the cursor on the highlighted item in the file browser, to aid
|
|
|
|
braille users.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set smooth
|
2019-02-20 16:23:25 +01:00
|
|
|
Deprecated option since it has become the default setting.
|
|
|
|
When needed, use \fBunset jumpyscrolling\fR instead.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set softwrap
|
2013-01-21 03:40:08 +00:00
|
|
|
Enable soft line wrapping for easier viewing of very long lines.
|
2009-08-17 07:52:10 +00:00
|
|
|
.TP
|
2019-08-16 18:46:34 +02:00
|
|
|
.B set speller """\fIprogram\fR [\fIarg\fR...]\fB"""
|
2018-05-30 19:57:28 +02:00
|
|
|
Use the given \fIprogram\fR to do spell checking and correcting,
|
|
|
|
instead of the built-in corrector that calls \fBspell\fR.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-05-04 10:24:34 +00:00
|
|
|
.B set statuscolor \fIfgcolor\fR,\fIbgcolor\fR
|
2017-06-18 19:53:18 +02:00
|
|
|
Specify the color combination to use for the status bar.
|
2014-05-04 10:24:34 +00:00
|
|
|
See \fBset titlecolor\fR for more details.
|
|
|
|
.TP
|
2019-03-03 11:38:53 +01:00
|
|
|
.B set stripecolor \fIfgcolor\fR,\fIbgcolor\fR
|
|
|
|
Specify the color combination to use for the vertical guiding stripe.
|
|
|
|
See \fBset titlecolor\fR for more details.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set suspend
|
2006-04-27 18:52:50 +00:00
|
|
|
Allow \fBnano\fP to be suspended.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.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.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set tabstospaces
|
2005-06-15 23:20:56 +00:00
|
|
|
Convert typed tabs to spaces.
|
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set tempfile
|
2003-02-09 01:28:40 +00:00
|
|
|
Save automatically on exit, don't prompt.
|
|
|
|
.TP
|
2014-05-04 10:24:34 +00:00
|
|
|
.B set titlecolor \fIfgcolor\fR,\fIbgcolor\fR
|
2017-06-18 19:53:18 +02:00
|
|
|
Specify the color combination to use for the title bar.
|
2016-10-29 20:47:37 +02:00
|
|
|
Valid names for the foreground and background colors are:
|
2018-03-27 19:32:08 +02:00
|
|
|
.BR white ", " black ", " blue ", " green ", " red ", "
|
|
|
|
.BR cyan ", " yellow ", " magenta ", and " normal
|
|
|
|
-- where \fBnormal\fR means the default foreground or background color.
|
2016-10-29 20:47:37 +02:00
|
|
|
The name of the foreground color may be prefixed with \fBbright\fR.
|
2014-05-04 10:24:34 +00:00
|
|
|
And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
|
|
|
|
.TP
|
2017-12-02 14:02:26 +01:00
|
|
|
.B set trimblanks
|
|
|
|
Remove trailing whitespace from wrapped lines when automatic
|
|
|
|
hard-wrapping occurs or when text is justified.
|
|
|
|
.TP
|
2015-08-04 18:49:57 +00:00
|
|
|
.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
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set view
|
2018-10-23 19:26:45 +02:00
|
|
|
Disallow file modification: read-only mode.
|
|
|
|
This mode allows the user to open also other files for viewing,
|
2019-03-24 11:32:01 +01:00
|
|
|
unless \fB\-\-restricted\fR is given on the command line.
|
2003-02-09 01:28:40 +00:00
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set whitespace """ characters """
|
2014-05-05 19:32:42 +00:00
|
|
|
Set the two characters used to indicate the presence of tabs and
|
2017-07-02 10:47:30 -05:00
|
|
|
spaces. They must be single-column characters. The default pair
|
2017-07-03 12:31:53 +02:00
|
|
|
for a UTF-8 locale is "\fB\[Fc]\[md]\fR", and for other locales "\fB>.\fR".
|
2004-05-29 16:25:30 +00:00
|
|
|
.TP
|
2014-08-03 20:57:15 +00:00
|
|
|
.B set 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.
|
2016-06-30 18:02:45 +02:00
|
|
|
.TP
|
2019-06-07 11:15:02 +02:00
|
|
|
.BI "set wordchars """ characters """
|
2016-06-30 18:02:45 +02:00
|
|
|
Specify which other characters (besides the normal alphanumeric ones)
|
|
|
|
should be considered as parts of words. This overrides the option
|
|
|
|
\fBwordbounds\fR.
|
2018-10-24 03:02:08 -06:00
|
|
|
.TP
|
|
|
|
.B set zap
|
|
|
|
Let an unmodified Backspace or Delete erase the marked region
|
|
|
|
(instead of a single character, and without affecting the cutbuffer).
|
2014-05-05 19:32:42 +00:00
|
|
|
|
|
|
|
.SH SYNTAX HIGHLIGHTING
|
|
|
|
Coloring the different syntactic elements of a file
|
2015-03-07 21:30:36 +00:00
|
|
|
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
|
2019-08-09 19:16:16 +02:00
|
|
|
All regular expressions in \fBnano\fR are POSIX extended regular expressions.
|
2019-06-06 15:00:34 +02:00
|
|
|
This means that \fB.\fR, \fB?\fR, \fB*\fR, \fB+\fR, \fB^\fR, \fB$\fR, and
|
|
|
|
several other characters are special.
|
|
|
|
The period \fB.\fR matches any single character,
|
|
|
|
\fB?\fR means the preceding item is optional,
|
|
|
|
\fB*\fR means the preceding item may be matched zero or more times,
|
|
|
|
\fB+\fR means the preceding item must be matched one or more times,
|
|
|
|
\fB^\fR matches the beginning of a line, and \fB$\fR the end,
|
|
|
|
\fB\\<\fR matches the start of a word, and \fB\\>\fR the end,
|
|
|
|
and \fB\\s\fR matches a blank.
|
|
|
|
It also means that lookahead and lookbehind are not possible.
|
2019-06-09 12:30:35 +02:00
|
|
|
A complete explanation can be found in the manual page of GNU grep:
|
|
|
|
\fBman grep\fR.
|
2019-06-06 15:00:34 +02:00
|
|
|
.sp
|
2017-07-14 15:21:30 +02:00
|
|
|
For each kind of file a separate syntax can be defined
|
2015-03-07 21:30:36 +00:00
|
|
|
via the following commands:
|
2005-08-10 22:51:49 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI syntax " name \fR[" """" fileregex """ " \fR...]
|
2017-07-14 15:21:30 +02:00
|
|
|
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.
|
2005-08-01 05:08:01 +00:00
|
|
|
|
2017-07-14 15:21:30 +02:00
|
|
|
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
|
2019-03-24 11:32:01 +01:00
|
|
|
activated by using the \fB\-Y\fR or \fB\-\-syntax\fR
|
2017-07-14 15:21:30 +02:00
|
|
|
command-line option followed by the \fIname\fR.
|
|
|
|
|
2018-05-31 11:25:21 +02:00
|
|
|
The syntax \fBdefault\fP is special: it takes no \fIfileregex\fR,
|
2017-07-14 15:21:30 +02:00
|
|
|
and applies to files that don't match any syntax's regexes.
|
2018-05-31 11:25:21 +02:00
|
|
|
The syntax \fBnone\fP is reserved; specifying it on the command line
|
2017-07-14 15:21:30 +02:00
|
|
|
is the same as not having a syntax at all.
|
2003-02-13 04:01:49 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "header """ regex """ \fR...
|
2017-07-15 12:32:57 +02:00
|
|
|
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
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "magic """ regex """ \fR...
|
2017-07-15 12:32:57 +02:00
|
|
|
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
|
2014-05-04 11:51:10 +00:00
|
|
|
.BI linter " program " \fR[ "arg " \fR...]
|
2018-05-30 19:57:28 +02:00
|
|
|
Use the given \fIprogram\fR to run a syntax check on the current buffer.
|
2014-02-24 10:18:15 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "comment """ string """
|
|
|
|
Use the given \fIstring\fR for commenting and uncommenting lines.
|
2017-07-06 21:35:07 +02:00
|
|
|
If the string contains a vertical bar or pipe character (\fB|\fR),
|
|
|
|
this designates bracket-style comments; for example, "\fB/*|*/\fR" for
|
2016-05-25 22:13:50 +02:00
|
|
|
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
|
2017-07-06 21:35:07 +02:00
|
|
|
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.
|
2017-07-02 10:47:30 -05:00
|
|
|
The default value is "\fB#\fP".
|
2016-05-25 22:13:50 +02:00
|
|
|
.TP
|
2019-09-22 12:31:12 +02:00
|
|
|
.BI "tabgives """ string """
|
|
|
|
Make the <Tab> key produce the given \fIstring\fR. Useful for languages like
|
|
|
|
Python that want to see only spaces for indentation.
|
|
|
|
This overrides the setting of the \fBtabstospaces\fR option.
|
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "color " fgcolor , bgcolor " """ regex """ " \fR...
|
2019-08-09 19:16:16 +02:00
|
|
|
Paint all pieces of text that match the extended regular expression
|
|
|
|
\fIregex\fP with the given foreground and background colors, at least
|
|
|
|
one of which must be specified. Valid color names are:
|
2018-08-10 19:32:45 +02:00
|
|
|
.BR white ", " black ", " blue ", " green ", " red ", "
|
|
|
|
.BR cyan ", " yellow ", " magenta ", and " normal
|
|
|
|
-- where \fBnormal\fR means the default foreground or background color.
|
2019-08-09 19:16:16 +02:00
|
|
|
You may use the prefix \fBbright\fR for the foreground color to get a
|
|
|
|
stronger highlight. If your terminal supports transparency, not specifying
|
|
|
|
a \fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent background.
|
2019-10-06 14:27:29 +02:00
|
|
|
.sp
|
|
|
|
All coloring commands are applied in the order in which they are specified,
|
|
|
|
which means that later commands can recolor stuff that was colored earlier.
|
2005-06-08 21:30:50 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "icolor " fgcolor , bgcolor " """ regex """ " \fR...
|
2017-04-21 11:27:12 +02:00
|
|
|
Same as above, except that the matching is case insensitive.
|
2005-06-27 03:07:10 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "color " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
2019-08-09 19:16:16 +02:00
|
|
|
Paint all pieces of text whose start matches extended regular expression
|
|
|
|
\fIfromrx\fP and whose end matches extended regular expression \fItorx\fP
|
|
|
|
with the given foreground and background colors,
|
2015-06-02 14:24:19 +00:00
|
|
|
at least one of which must be specified. This means that, after an
|
2017-04-21 11:27:12 +02:00
|
|
|
initial instance of \fIfromrx\fP, all text until the first instance of
|
|
|
|
\fItorx\fP will be colored. This allows syntax highlighting to span
|
2015-06-02 14:24:19 +00:00
|
|
|
multiple lines.
|
2005-06-27 03:07:10 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "icolor " fgcolor , bgcolor " start=""" fromrx """ end=""" torx """
|
2017-04-21 11:27:12 +02:00
|
|
|
Same as above, except that the matching is case insensitive.
|
2006-04-13 02:43:54 +00:00
|
|
|
.TP
|
2018-05-31 12:02:36 +02:00
|
|
|
.BI "include """ syntaxfile """
|
2006-04-13 02:43:54 +00:00
|
|
|
Read in self-contained color syntaxes from \fIsyntaxfile\fP. Note that
|
2015-06-02 14:24:19 +00:00
|
|
|
\fIsyntaxfile\fP may contain only the above commands, from \fBsyntax\fP
|
2014-05-05 19:32:42 +00:00
|
|
|
to \fBicolor\fP.
|
2014-03-02 05:27:56 +00:00
|
|
|
.TP
|
2017-07-14 15:21:30 +02:00
|
|
|
.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,
|
2018-07-10 16:24:22 +02:00
|
|
|
\fBheader\fP, \fBmagic\fP, \fBcomment\fP, or \fBlinter\fP
|
2017-07-14 15:21:30 +02:00
|
|
|
command to an already defined syntax -- useful when you want to
|
2015-06-02 14:24:19 +00:00
|
|
|
slightly improve a syntax defined in one of the system-installed
|
2017-07-14 15:21:30 +02:00
|
|
|
files (which normally are not writable).
|
2017-04-19 20:31:04 +02:00
|
|
|
|
2018-08-09 20:25:43 +02:00
|
|
|
.P
|
|
|
|
Note: the \fBformatter\fR command has been removed. It was superseded by
|
|
|
|
a more general mechanism: the filtering of buffer or marked text through
|
|
|
|
an external command. Such filtering is done by typing \fB^R^X\fR and then
|
|
|
|
preceding your formatter command with the pipe symbol (\fB|\fR). It has
|
|
|
|
the added advantage that the operation can be undone.
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2018-08-09 20:25:43 +02:00
|
|
|
If you use such a formatting command regularly, you could assign the relevant
|
|
|
|
series of keystrokes to a single key in your nanorc:
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2018-08-09 20:25:43 +02:00
|
|
|
.RS
|
|
|
|
.B "bind M\-F \(dq^R^X|yourformatcommand^M\(dq main"
|
|
|
|
.RE
|
2019-04-01 17:31:35 +02:00
|
|
|
.sp
|
2018-08-09 20:25:43 +02:00
|
|
|
(Note that the \fB^R\fR, \fB^X\fR, and \fB^M\fR are each a single, literal
|
2019-03-24 11:32:01 +01:00
|
|
|
control character. You can enter them by preceding each with \fBM\-V\fR.)
|
2018-08-09 20:25:43 +02:00
|
|
|
|
2014-05-05 19:32:42 +00:00
|
|
|
.SH REBINDING KEYS
|
2018-02-27 20:11:17 +01:00
|
|
|
Key bindings can be changed via the following three commands:
|
|
|
|
.RS 3
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2014-05-04 11:51:10 +00:00
|
|
|
.BI bind " key function menu"
|
2008-03-05 07:35:01 +00:00
|
|
|
Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
|
2014-06-27 16:27:52 +00:00
|
|
|
context of menu \fImenu\fP (or in all menus where the function exists
|
|
|
|
by using \fBall\fP).
|
2018-02-27 20:11:17 +01:00
|
|
|
.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
|
2019-03-24 11:32:01 +01:00
|
|
|
with \fBM\-V\fR.)
|
2018-02-27 20:11:17 +01:00
|
|
|
|
2014-02-27 19:57:52 +00:00
|
|
|
.TP
|
2014-05-04 11:51:10 +00:00
|
|
|
.BI unbind " key menu"
|
2014-06-20 18:40:34 +00:00
|
|
|
Unbinds the key \fIkey\fP from the menu named \fImenu\fP (or from all
|
2014-02-27 19:57:52 +00:00
|
|
|
menus where it exists by using \fBall\fP).
|
2018-02-27 20:11:17 +01:00
|
|
|
.RE
|
2014-02-27 19:57:52 +00:00
|
|
|
|
|
|
|
.TP
|
|
|
|
The format of \fIkey\fP should be one of:
|
2015-03-07 21:48:15 +00:00
|
|
|
.RS 3
|
|
|
|
.TP 3
|
2014-06-20 18:40:34 +00:00
|
|
|
.B ^
|
2018-07-19 20:11:02 +02:00
|
|
|
followed by a Latin letter, by one of several ASCII characters
|
|
|
|
(@, ], \\, ^, or _), or by the word "Space".
|
|
|
|
Example: ^C.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2019-03-24 11:32:01 +01:00
|
|
|
.B M\-
|
2018-07-19 20:11:02 +02:00
|
|
|
followed by any ASCII character except [, or by the word "Space".
|
2019-03-24 11:32:01 +01:00
|
|
|
Example: M\-C.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2014-06-20 18:40:34 +00:00
|
|
|
.B F
|
2008-03-16 23:57:14 +00:00
|
|
|
followed by a numeric value from 1 to 16.
|
2018-07-19 20:11:02 +02:00
|
|
|
Example: F10.
|
2018-06-09 11:54:44 -05:00
|
|
|
.TP
|
|
|
|
the word "Ins" or the word "Del".
|
2015-03-07 21:48:15 +00:00
|
|
|
.RE
|
2014-02-27 19:57:52 +00:00
|
|
|
|
2015-03-07 21:48:15 +00:00
|
|
|
.TP
|
2015-08-04 19:51:02 +00:00
|
|
|
Valid \fIfunction\fP names to be bound are:
|
2015-03-07 21:48:15 +00:00
|
|
|
.RS 3
|
2014-02-27 19:57:52 +00:00
|
|
|
.TP 2
|
2008-03-05 07:35:01 +00:00
|
|
|
.B help
|
2014-05-09 21:02:14 +00:00
|
|
|
Invokes the help viewer.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B cancel
|
2014-05-09 21:02:14 +00:00
|
|
|
Cancels the current command.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B exit
|
2014-05-09 21:02:14 +00:00
|
|
|
Exits from the program (or from the help viewer or the file browser).
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B writeout
|
2015-07-25 19:25:50 +00:00
|
|
|
Writes the current buffer to disk, asking for a name.
|
|
|
|
.TP
|
|
|
|
.B savefile
|
2017-11-17 21:52:31 +01:00
|
|
|
Writes the current file to disk without prompting.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B insert
|
2015-04-18 16:07:53 +00:00
|
|
|
Inserts a file into the current buffer (at the current cursor position),
|
|
|
|
or into a new buffer when option \fBmultibuffer\fR is set.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B whereis
|
2017-09-17 22:07:25 +02:00
|
|
|
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
|
2018-07-28 11:15:41 +02:00
|
|
|
Starts a backward search for text in the current buffer -- or for filenames
|
|
|
|
matching a string in the current list in the file browser.
|
2015-07-26 09:23:24 +00:00
|
|
|
.TP
|
|
|
|
.B findprevious
|
2018-07-28 11:15:41 +02:00
|
|
|
Searches the next occurrence in the backward direction.
|
2015-07-26 09:23:24 +00:00
|
|
|
.TP
|
|
|
|
.B findnext
|
2018-07-28 11:15:41 +02:00
|
|
|
Searches the next occurrence in the forward direction.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2014-04-26 20:16:17 +00:00
|
|
|
.B replace
|
2014-05-09 21:02:14 +00:00
|
|
|
Interactively replaces text within the current buffer.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
|
|
|
.B cut
|
2014-05-09 21:02:14 +00:00
|
|
|
Cuts and stores the current line (or the marked region).
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2018-06-01 12:47:04 +02:00
|
|
|
.B copy
|
2014-05-09 21:02:14 +00:00
|
|
|
Copies the current line (or the marked region) without deleting it.
|
2014-04-26 20:16:17 +00:00
|
|
|
.TP
|
2018-06-01 12:47:04 +02:00
|
|
|
.B paste
|
|
|
|
Pastes the currently stored text into the current buffer at the
|
2014-05-09 21:02:14 +00:00
|
|
|
current cursor position.
|
2008-03-05 07:35:01 +00:00
|
|
|
.TP
|
2018-10-23 20:25:22 -06:00
|
|
|
.B zap
|
2018-12-10 11:57:14 +01:00
|
|
|
Throws away the current line (or the marked region).
|
2018-10-24 03:17:28 -06:00
|
|
|
(This function is bound by default to <Meta+Delete>.)
|
2018-10-23 20:25:22 -06:00
|
|
|
.TP
|
2019-02-24 17:04:17 +01:00
|
|
|
.B chopwordleft
|
2019-02-24 11:00:06 +01:00
|
|
|
Deletes from the cursor position to the beginning of the preceding word.
|
2019-02-24 11:17:31 +01:00
|
|
|
(This function is bound by default to <Shift+Ctrl+Delete>. If your terminal
|
|
|
|
produces \fB^H\fR for <Ctrl+Backspace>, you can make <Ctrl+Backspace> delete
|
2018-07-22 08:32:15 +02:00
|
|
|
the word to the left of the cursor by rebinding ^H to this function.)
|
2015-07-31 11:52:26 +00:00
|
|
|
.TP
|
2019-02-24 17:04:17 +01:00
|
|
|
.B chopwordright
|
2019-02-24 11:00:06 +01:00
|
|
|
Deletes from the cursor position to the beginning of the next word.
|
2018-07-22 08:32:15 +02:00
|
|
|
(This function is bound by default to <Ctrl+Delete>.)
|
2015-07-31 11:52:26 +00:00
|
|
|
.TP
|
|