Blame doc/nano.info

Packit 1ac44c
This is nano.info, produced by makeinfo version 6.5 from nano.texi.
Packit 1ac44c
Packit 1ac44c
INFO-DIR-SECTION Editors
Packit 1ac44c
START-INFO-DIR-ENTRY
Packit 1ac44c
* nano: (nano).                 Small and friendly text editor.
Packit 1ac44c
END-INFO-DIR-ENTRY
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Top,  Next: Introduction,  Up: (dir)
Packit 1ac44c
Packit 1ac44c
nano
Packit 1ac44c
****
Packit 1ac44c
Packit 1ac44c
This manual documents the GNU ‘nano’ editor, version 2.9.8.
Packit 1ac44c
Packit 1ac44c
* Menu:
Packit 1ac44c
Packit 1ac44c
* Introduction::
Packit 1ac44c
* Invoking::
Packit 1ac44c
* Command-line Options::
Packit 1ac44c
* Editor Basics::
Packit 1ac44c
* Built-in Help::
Packit 1ac44c
* Feature Toggles::
Packit 1ac44c
* Nanorc Files::
Packit 1ac44c
* The File Browser::
Packit 1ac44c
* Pico Compatibility::
Packit 1ac44c
* Building and Configure Options::
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Introduction,  Next: Invoking,  Prev: Top,  Up: Top
Packit 1ac44c
Packit 1ac44c
1 Introduction
Packit 1ac44c
**************
Packit 1ac44c
Packit 1ac44c
GNU ‘nano’ is a small and friendly text editor.  Besides basic text
Packit 1ac44c
editing, ‘nano’ offers many extra features, such as an interactive
Packit 1ac44c
search-and-replace, undo/redo, syntax coloring, smooth scrolling,
Packit 1ac44c
auto-indentation, go-to-line-and-column-number, feature toggles, file
Packit 1ac44c
locking, backup files, and internationalization support.
Packit 1ac44c
Packit 1ac44c
   The original goal for ‘nano’ was to be a complete bug-for-bug
Packit 1ac44c
emulation of Pico.  But currently the goal is to be as compatible as
Packit 1ac44c
possible while offering a superset of Pico’s functionality.  *Note Pico
Packit 1ac44c
Compatibility:: for more details on how ‘nano’ and Pico differ.
Packit 1ac44c
Packit 1ac44c
   Please report bugs via <https://savannah.gnu.org/bugs/?group=nano>.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Invoking,  Next: Command-line Options,  Prev: Introduction,  Up: Top
Packit 1ac44c
Packit 1ac44c
2 Invoking
Packit 1ac44c
**********
Packit 1ac44c
Packit 1ac44c
The usual way to invoke ‘nano’ is:
Packit 1ac44c
Packit 1ac44c
     nano [FILE]
Packit 1ac44c
Packit 1ac44c
   But it is also possible to specify one or more options (see the next
Packit 1ac44c
section), and to edit several files in a row.  Additionally, the cursor
Packit 1ac44c
can be put on a specific line of a file by adding the line number with a
Packit 1ac44c
plus sign before the filename, and even in a specific column by adding
Packit 1ac44c
it with a comma.  So a more complete command synopsis is:
Packit 1ac44c
Packit 1ac44c
     nano [OPTION]... [[+LINE[,COLUMN]|+,COLUMN] FILE]...
Packit 1ac44c
Packit 1ac44c
   Normally, however, you set your preferred options in a ‘nanorc’ file
Packit 1ac44c
(*note Nanorc Files::).  And when using ‘set positionlog’ (making ‘nano’
Packit 1ac44c
remember the cursor position when you close a file), you will rarely
Packit 1ac44c
need to specify a line number.
Packit 1ac44c
Packit 1ac44c
   As a special case: when instead of a filename a dash is given, ‘nano’
Packit 1ac44c
will read data from standard input.  This means you can pipe the output
Packit 1ac44c
of a command straight into a buffer, and then edit it.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Command-line Options,  Next: Editor Basics,  Prev: Invoking,  Up: Top
Packit 1ac44c
Packit 1ac44c
3 Command-line Options
Packit 1ac44c
**********************
Packit 1ac44c
Packit 1ac44c
‘nano’ takes the following options from the command line:
Packit 1ac44c
Packit 1ac44c
‘-A’
Packit 1ac44c
‘--smarthome’
Packit 1ac44c
     Make the Home key smarter.  When Home is pressed anywhere but at
Packit 1ac44c
     the very beginning of non-whitespace characters on a line, the
Packit 1ac44c
     cursor will jump to that beginning (either forwards or backwards).
Packit 1ac44c
     If the cursor is already at that position, it will jump to the true
Packit 1ac44c
     beginning of the line.
Packit 1ac44c
Packit 1ac44c
‘-B’
Packit 1ac44c
‘--backup’
Packit 1ac44c
     When saving a file, back up the previous version of it, using the
Packit 1ac44c
     current filename suffixed with a tilde (‘~’).
Packit 1ac44c
Packit 1ac44c
‘-C DIRECTORY’
Packit 1ac44c
‘--backupdir=DIRECTORY’
Packit 1ac44c
     Make and keep not just one backup file, but make and keep a
Packit 1ac44c
     uniquely numbered one every time a file is saved — when backups are
Packit 1ac44c
     enabled.  The uniquely numbered files are stored in the specified
Packit 1ac44c
     directory.
Packit 1ac44c
Packit 1ac44c
‘-D’
Packit 1ac44c
‘--boldtext’
Packit 1ac44c
     Use bold text instead of reverse video text.
Packit 1ac44c
Packit 1ac44c
‘-E’
Packit 1ac44c
‘--tabstospaces’
Packit 1ac44c
     Convert typed tabs to spaces.
Packit 1ac44c
Packit 1ac44c
‘-F’
Packit 1ac44c
‘--multibuffer’
Packit 1ac44c
     Read a file into a new buffer by default.
Packit 1ac44c
Packit 1ac44c
‘-G’
Packit 1ac44c
‘--locking’
Packit 1ac44c
     Enable vim-style file locking when editing files.
Packit 1ac44c
Packit 1ac44c
‘-H’
Packit 1ac44c
‘--historylog’
Packit 1ac44c
     Save the last hundred search strings and replacement strings and
Packit 1ac44c
     executed commands, so they can be easily reused in later sessions.
Packit 1ac44c
Packit 1ac44c
‘-I’
Packit 1ac44c
‘--ignorercfiles’
Packit 1ac44c
     Don’t look at the system’s nanorc file nor at the user’s nanorc.
Packit 1ac44c
Packit 1ac44c
‘-K’
Packit 1ac44c
‘--rebindkeypad’
Packit 1ac44c
     Interpret the numeric keypad keys so that they all work properly.
Packit 1ac44c
     You should only need to use this option if they don’t, as mouse
Packit 1ac44c
     support won’t work properly with this option enabled.
Packit 1ac44c
Packit 1ac44c
‘-L’
Packit 1ac44c
‘--nonewlines’
Packit 1ac44c
     Don’t automatically add a newline when a file does not end with
Packit 1ac44c
     one.
Packit 1ac44c
Packit 1ac44c
‘-M’
Packit 1ac44c
‘--trimblanks’
Packit 1ac44c
     Snip trailing whitespace from the wrapped line when automatic
Packit 1ac44c
     hard-wrapping occurs or when text is justified.
Packit 1ac44c
Packit 1ac44c
‘-N’
Packit 1ac44c
‘--noconvert’
Packit 1ac44c
     Disable automatic conversion of files from DOS/Mac format.
Packit 1ac44c
Packit 1ac44c
‘-O’
Packit 1ac44c
‘--morespace’
Packit 1ac44c
     Use the blank line below the title bar as extra editing space.
Packit 1ac44c
Packit 1ac44c
‘-P’
Packit 1ac44c
‘--positionlog’
Packit 1ac44c
     For the 200 most recent files, log the last position of the cursor,
Packit 1ac44c
     and place it at that position again upon reopening such a file.
Packit 1ac44c
Packit 1ac44c
‘-Q "REGEX"’
Packit 1ac44c
‘--quotestr="REGEX"’
Packit 1ac44c
     Set the regular expression for matching the quoting part of a line,
Packit 1ac44c
     used when justifying.  The default value is
Packit 1ac44c
     "^([ \t]*([#:>|}]|//))+".  Note that ‘\t’ stands for a literal Tab
Packit 1ac44c
     character.
Packit 1ac44c
Packit 1ac44c
‘-R’
Packit 1ac44c
‘--restricted’
Packit 1ac44c
     Restricted mode: don’t read or write to any file not specified on
Packit 1ac44c
     the command line; don’t read any nanorc files nor history files;
Packit 1ac44c
     don’t allow suspending nor spell checking; don’t allow a file to be
Packit 1ac44c
     appended to, prepended to, or saved under a different name if it
Packit 1ac44c
     already has one; and don’t use backup files.  This restricted mode
Packit 1ac44c
     is also accessible by invoking ‘nano’ with any name beginning with
Packit 1ac44c
     ‘r’ (e.g. ‘rnano’).
Packit 1ac44c
Packit 1ac44c
‘-S’
Packit 1ac44c
‘--smooth’
Packit 1ac44c
     Enable smooth scrolling.  Text will scroll line-by-line, instead of
Packit 1ac44c
     the usual chunk-by-chunk behavior.
Packit 1ac44c
Packit 1ac44c
‘-T NUMBER’
Packit 1ac44c
‘--tabsize=NUMBER’
Packit 1ac44c
     Set the displayed tab length to NUMBER columns.  The value of
Packit 1ac44c
     NUMBER must be greater than 0.  The default value is 8.
Packit 1ac44c
Packit 1ac44c
‘-U’
Packit 1ac44c
‘--quickblank’
Packit 1ac44c
     Do quick status-bar blanking: status-bar messages will disappear
Packit 1ac44c
     after 1 keystroke instead of 25.  Note that option ‘-c’
Packit 1ac44c
     (‘--constantshow’) overrides this.
Packit 1ac44c
Packit 1ac44c
‘-V’
Packit 1ac44c
‘--version’
Packit 1ac44c
     Show the current version number and exit.
Packit 1ac44c
Packit 1ac44c
‘-W’
Packit 1ac44c
‘--wordbounds’
Packit 1ac44c
     Detect word boundaries differently by treating punctuation
Packit 1ac44c
     characters as parts of words.
Packit 1ac44c
Packit 1ac44c
‘-X "CHARACTERS"’
Packit 1ac44c
‘--wordchars="CHARACTERS"’
Packit 1ac44c
     Specify which other characters (besides the normal alphanumeric
Packit 1ac44c
     ones) should be considered as parts of words.  This overrides
Packit 1ac44c
     option ‘-W’ (‘--wordbounds’).
Packit 1ac44c
Packit 1ac44c
‘-Y NAME’
Packit 1ac44c
‘--syntax=NAME’
Packit 1ac44c
     Specify the syntax to be used for highlighting.  *Note Syntax
Packit 1ac44c
     Highlighting:: for more info.
Packit 1ac44c
Packit 1ac44c
‘-a’
Packit 1ac44c
‘--atblanks’
Packit 1ac44c
     When doing soft line wrapping, wrap lines at whitespace instead of
Packit 1ac44c
     always at the edge of the screen.
Packit 1ac44c
Packit 1ac44c
‘-c’
Packit 1ac44c
‘--constantshow’
Packit 1ac44c
     Constantly display the cursor position (line number, column number,
Packit 1ac44c
     and character number) on the status bar.  Note that this overrides
Packit 1ac44c
     option ‘-U’ (‘--quickblank’).
Packit 1ac44c
Packit 1ac44c
‘-d’
Packit 1ac44c
‘--rebinddelete’
Packit 1ac44c
     Interpret the Delete key differently so that both Backspace and
Packit 1ac44c
     Delete work properly.  You should only need to use this option if
Packit 1ac44c
     Backspace acts like Delete on your system.
Packit 1ac44c
Packit 1ac44c
‘-g’
Packit 1ac44c
‘--showcursor’
Packit 1ac44c
     Make the cursor visible in the file browser, putting it on the
Packit 1ac44c
     highlighted item.  Useful for braille users.
Packit 1ac44c
Packit 1ac44c
‘-h’
Packit 1ac44c
‘--help’
Packit 1ac44c
     Show a summary of command-line options and exit.
Packit 1ac44c
Packit 1ac44c
‘-i’
Packit 1ac44c
‘--autoindent’
Packit 1ac44c
     Automatically indent a newly created line to the same number of
Packit 1ac44c
     tabs and/or spaces as the previous line (or as the next line if the
Packit 1ac44c
     previous line is the beginning of a paragraph).
Packit 1ac44c
Packit 1ac44c
‘-k’
Packit 1ac44c
‘--cutfromcursor’
Packit 1ac44c
     Make the ’Cut Text’ command (normally ‘^K’) cut from the current
Packit 1ac44c
     cursor position to the end of the line, instead of cutting the
Packit 1ac44c
     entire line.
Packit 1ac44c
Packit 1ac44c
‘-l’
Packit 1ac44c
‘--linenumbers’
Packit 1ac44c
     Display line numbers to the left of the text area.
Packit 1ac44c
Packit 1ac44c
‘-m’
Packit 1ac44c
‘--mouse’
Packit 1ac44c
     Enable mouse support, if available for your system.  When enabled,
Packit 1ac44c
     mouse clicks can be used to place the cursor, set the mark (with a
Packit 1ac44c
     double click), and execute shortcuts.  The mouse will work in the X
Packit 1ac44c
     Window System, and on the console when gpm is running.  Text can
Packit 1ac44c
     still be selected through dragging by holding down the Shift key.
Packit 1ac44c
Packit 1ac44c
‘-n’
Packit 1ac44c
‘--noread’
Packit 1ac44c
     Treat any name given on the command line as a new file.  This
Packit 1ac44c
     allows ‘nano’ to write to named pipes: it will start with a blank
Packit 1ac44c
     buffer, and will write to the pipe when the user saves the "file".
Packit 1ac44c
     This way ‘nano’ can be used as an editor in combination with for
Packit 1ac44c
     instance ‘gpg’ without having to write sensitive data to disk
Packit 1ac44c
     first.
Packit 1ac44c
Packit 1ac44c
‘-o DIRECTORY’
Packit 1ac44c
‘--operatingdir=DIRECTORY’
Packit 1ac44c
     Set the operating directory.  This makes ‘nano’ set up something
Packit 1ac44c
     similar to a chroot.
Packit 1ac44c
Packit 1ac44c
‘-p’
Packit 1ac44c
‘--preserve’
Packit 1ac44c
     Preserve the ‘^Q’ (XON) and ‘^S’ (XOFF) sequences so data being
Packit 1ac44c
     sent to the editor can be stopped and started.
Packit 1ac44c
Packit 1ac44c
‘-q’
Packit 1ac44c
‘--quiet’
Packit 1ac44c
     Obsolete option.  Recognized but ignored.
Packit 1ac44c
Packit 1ac44c
‘-r NUMBER’
Packit 1ac44c
‘--fill=NUMBER’
Packit 1ac44c
     Hard-wrap lines at column NUMBER (by inserting a newline
Packit 1ac44c
     character).  If the given value is 0 or less, wrapping will occur
Packit 1ac44c
     at the width of the screen minus the given amount, allowing the
Packit 1ac44c
     wrapping width to vary along with the width of the screen if and
Packit 1ac44c
     when it is resized.  The default value is -8.  This option
Packit 1ac44c
     conflicts with ‘-w’ (‘--nowrap’); the last one given takes effect.
Packit 1ac44c
Packit 1ac44c
‘-s PROGRAM’
Packit 1ac44c
‘--speller=PROGRAM’
Packit 1ac44c
     Use the given program to do spell checking and correcting.  By
Packit 1ac44c
     default, ‘nano’ uses the command specified in the ‘SPELL’
Packit 1ac44c
     environment variable.  If ‘SPELL’ is not set, and ‘--speller’ is
Packit 1ac44c
     not specified either, then ‘nano’ uses its own interactive spell
Packit 1ac44c
     corrector, which requires the GNU ‘spell’ program to be installed.
Packit 1ac44c
Packit 1ac44c
‘-t’
Packit 1ac44c
‘--tempfile’
Packit 1ac44c
     Don’t ask whether to save a modified buffer when exiting with ‘^X’,
Packit 1ac44c
     but assume yes.  This option is useful when ‘nano’ is used as the
Packit 1ac44c
     composer of a mailer program.
Packit 1ac44c
Packit 1ac44c
‘-u’
Packit 1ac44c
‘--unix’
Packit 1ac44c
     Save a file by default in Unix format.  This overrides nano’s
Packit 1ac44c
     default behavior of saving a file in the format that it had.  (This
Packit 1ac44c
     option has no effect when you also use ‘--noconvert’.)
Packit 1ac44c
Packit 1ac44c
‘-v’
Packit 1ac44c
‘--view’
Packit 1ac44c
     Don’t allow the contents of the file to be altered.  Note that this
Packit 1ac44c
     option should NOT be used in place of correct file permissions to
Packit 1ac44c
     implement a read-only file.
Packit 1ac44c
Packit 1ac44c
‘-w’
Packit 1ac44c
‘--nowrap’
Packit 1ac44c
     Don’t hard-wrap long lines at any length.  This option conflicts
Packit 1ac44c
     with ‘-r’ (‘--fill’); the last one given takes effect.
Packit 1ac44c
Packit 1ac44c
‘-x’
Packit 1ac44c
‘--nohelp’
Packit 1ac44c
     Expert Mode: don’t show the Shortcut List at the bottom of the
Packit 1ac44c
     screen.  This affects the location of the status bar as well, as in
Packit 1ac44c
     Expert Mode it is located at the very bottom of the editor.
Packit 1ac44c
Packit 1ac44c
     Note: When accessing the help system, Expert Mode is temporarily
Packit 1ac44c
     disabled to display the help-system navigation keys.
Packit 1ac44c
Packit 1ac44c
‘-y’
Packit 1ac44c
‘--afterends’
Packit 1ac44c
     Make Ctrl+Right stop at word ends instead of beginnings.
Packit 1ac44c
Packit 1ac44c
‘-z’
Packit 1ac44c
‘--suspend’
Packit 1ac44c
     Enable the ability to suspend ‘nano’ using the system’s suspend
Packit 1ac44c
     keystroke (usually ‘^Z’).
Packit 1ac44c
Packit 1ac44c
‘-$’
Packit 1ac44c
‘--softwrap’
Packit 1ac44c
     Enable ’soft wrapping’.  This will make ‘nano’ attempt to display
Packit 1ac44c
     the entire contents of any line, even if it is longer than the
Packit 1ac44c
     screen width, by continuing it over multiple screen lines.  Since
Packit 1ac44c
     ‘$’ normally refers to a variable in the Unix shell, you should
Packit 1ac44c
     specify this option last when using other options (e.g. ‘nano
Packit 1ac44c
     -wS$’) or pass it separately (e.g. ‘nano -wS -$’).
Packit 1ac44c
Packit 1ac44c
‘-b’
Packit 1ac44c
‘-e’
Packit 1ac44c
‘-f’
Packit 1ac44c
‘-j’
Packit 1ac44c
     Ignored, for compatibility with Pico.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Editor Basics,  Next: Built-in Help,  Prev: Command-line Options,  Up: Top
Packit 1ac44c
Packit 1ac44c
4 Editor Basics
Packit 1ac44c
***************
Packit 1ac44c
Packit 1ac44c
* Menu:
Packit 1ac44c
Packit 1ac44c
* Entering Text::
Packit 1ac44c
* Commands::
Packit 1ac44c
* The Cutbuffer::
Packit 1ac44c
* The Mark::
Packit 1ac44c
* Screen Layout::
Packit 1ac44c
* Search and Replace::
Packit 1ac44c
* Using the Mouse::
Packit 1ac44c
* Limitations::
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Entering Text,  Next: Commands,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.1 Entering Text
Packit 1ac44c
=================
Packit 1ac44c
Packit 1ac44c
‘nano’ is a "modeless" editor.  This means that all keystrokes, with the
Packit 1ac44c
exception of Control and Meta sequences, enter text into the file being
Packit 1ac44c
edited.
Packit 1ac44c
Packit 1ac44c
   Characters not present on the keyboard can be entered in two ways:
Packit 1ac44c
Packit 1ac44c
   • For characters with a single-byte code, pressing the Esc key twice
Packit 1ac44c
     and then typing a three-digit decimal number (from ‘000’ to ‘255’)
Packit 1ac44c
     will make ‘nano’ behave as if you typed the key with that value.
Packit 1ac44c
Packit 1ac44c
   • For any possible character, pressing ‘M-V’ (Alt+V) and then typing
Packit 1ac44c
     a six-digit hexadecimal number (starting with ‘0’ or ‘1’) will
Packit 1ac44c
     enter the corresponding Unicode character into the buffer.
Packit 1ac44c
Packit 1ac44c
   For example, typing ‘Esc Esc 2 3 4’ will enter the character "ê" —
Packit 1ac44c
useful when writing about a French party.  Typing ‘M-V 0 0 2 2 c 4’ will
Packit 1ac44c
enter the symbol "⋄", a little diamond.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Commands,  Next: The Cutbuffer,  Prev: Entering Text,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.2 Commands
Packit 1ac44c
============
Packit 1ac44c
Packit 1ac44c
Commands are given by using the Control key (Ctrl, shown as ‘^’) or the
Packit 1ac44c
Meta key (Alt or Cmd, shown as ‘M-’).
Packit 1ac44c
Packit 1ac44c
   • A control-key sequence is entered by holding down the Ctrl key and
Packit 1ac44c
     pressing the desired key.
Packit 1ac44c
Packit 1ac44c
   • A meta-key sequence is entered by holding down the Meta key
Packit 1ac44c
     (normally the Alt key) and pressing the desired key.
Packit 1ac44c
Packit 1ac44c
   If for some reason on your system the combinations with Ctrl or Alt
Packit 1ac44c
do not work, you can generate them by using the Esc key.  A control-key
Packit 1ac44c
sequence is generated by pressing the Esc key twice and then pressing
Packit 1ac44c
the desired key, and a meta-key sequence by pressing the Esc key once
Packit 1ac44c
and then pressing the desired key.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: The Cutbuffer,  Next: The Mark,  Prev: Commands,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.3 The Cutbuffer
Packit 1ac44c
=================
Packit 1ac44c
Packit 1ac44c
Text can be cut from a file, a whole line at a time, by using the ’Cut
Packit 1ac44c
Text’ command (default key binding: ‘^K’).  The cut line is stored in
Packit 1ac44c
the cutbuffer.  Consecutive strokes of ‘^K’ will add each cut line to
Packit 1ac44c
this buffer, but a ‘^K’ after any other keystroke will overwrite the
Packit 1ac44c
entire cutbuffer.
Packit 1ac44c
Packit 1ac44c
   The contents of the cutbuffer can be pasted back into the file with
Packit 1ac44c
the ’Uncut Text’ command (default key binding: ‘^U’).
Packit 1ac44c
Packit 1ac44c
   A line of text can be copied into the cutbuffer (without cutting it)
Packit 1ac44c
with the ’Copy Text’ command (default key binding: ‘M-6’).
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: The Mark,  Next: Screen Layout,  Prev: The Cutbuffer,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.4 The Mark
Packit 1ac44c
============
Packit 1ac44c
Packit 1ac44c
Text can be selected by first ’setting the Mark’ (default key bindings:
Packit 1ac44c
‘^6’ and ‘M-A’) and then moving the cursor to the other end of the
Packit 1ac44c
portion to be selected.  The selected portion of text will be
Packit 1ac44c
highlighted.  This selection can now be cut or copied in its entirety
Packit 1ac44c
with a single ‘^K’ or ‘M-6’.  Or the selection can be used to limit the
Packit 1ac44c
scope of a search-and-replace (‘^\’) or spell-checking session (‘^T’).
Packit 1ac44c
Packit 1ac44c
   On some terminals, it is also possible to select text by holding down
Packit 1ac44c
‘Shift’ together with the cursor keys.  Such a selection is cancelled
Packit 1ac44c
upon any cursor movement where ‘Shift’ isn’t held.
Packit 1ac44c
Packit 1ac44c
   Cutting or copying selected text will toggle the mark off
Packit 1ac44c
automatically.  If necessary, it can be toggled off manually with
Packit 1ac44c
another ‘^6’ or ‘M-A’.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Screen Layout,  Next: Search and Replace,  Prev: The Mark,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.5 Screen Layout
Packit 1ac44c
=================
Packit 1ac44c
Packit 1ac44c
The default screen of nano consists of five areas.  From top to bottom
Packit 1ac44c
these are: the title bar, a blank line, the edit window, the status bar,
Packit 1ac44c
and two help lines.
Packit 1ac44c
Packit 1ac44c
   The title bar consists of three sections: left, center and right.
Packit 1ac44c
The section on the left displays the version of ‘nano’ being used.  The
Packit 1ac44c
center section displays the current filename, or "New Buffer" if the
Packit 1ac44c
file has not yet been named.  The section on the right displays
Packit 1ac44c
"Modified" if the file has been modified since it was last saved or
Packit 1ac44c
opened.
Packit 1ac44c
Packit 1ac44c
   The status bar is the third line from the bottom of the screen.  It
Packit 1ac44c
shows important and informational messages.  Any error messages that
Packit 1ac44c
occur from using the editor will appear on the status bar.  Any
Packit 1ac44c
questions that are asked of the user will be asked on the status bar,
Packit 1ac44c
and any user input (search strings, filenames, etc.)  will be input on
Packit 1ac44c
the status bar.
Packit 1ac44c
Packit 1ac44c
   The two help lines at the bottom of the screen show some of the most
Packit 1ac44c
essential functions of the editor.  These two lines are called the
Packit 1ac44c
Shortcut List.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Search and Replace,  Next: Using the Mouse,  Prev: Screen Layout,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.6 Search and Replace
Packit 1ac44c
======================
Packit 1ac44c
Packit 1ac44c
One can search the current buffer for the occurrence of any string with
Packit 1ac44c
the Search command (default key binding: ‘^W’).  The default search mode
Packit 1ac44c
is forward, case-insensitive, and for literal strings.  But one can
Packit 1ac44c
search backwards by pressing ‘M-B’, search case sensitively with ‘M-C’,
Packit 1ac44c
and interpret regular expressions in the search string with ‘M-R’.
Packit 1ac44c
Packit 1ac44c
   A regular expression in a search string always covers just one line;
Packit 1ac44c
it cannot span multiple lines.  And when replacing (with ‘^\’ or ‘M-R’)
Packit 1ac44c
the replacement string cannot contain a newline (LF).
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Using the Mouse,  Next: Limitations,  Prev: Search and Replace,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.7 Using the Mouse
Packit 1ac44c
===================
Packit 1ac44c
Packit 1ac44c
When mouse support has been configured and enabled, a single mouse click
Packit 1ac44c
places the cursor at the indicated position.  Clicking a second time in
Packit 1ac44c
the same position toggles the mark.  Clicking in the shortcut list
Packit 1ac44c
executes the selected shortcut.  To be able to select text with the left
Packit 1ac44c
button, or paste text with the middle button, hold down the Shift key
Packit 1ac44c
during those actions.
Packit 1ac44c
Packit 1ac44c
   The mouse will work in the X Window System, and on the console when
Packit 1ac44c
gpm is running.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Limitations,  Prev: Using the Mouse,  Up: Editor Basics
Packit 1ac44c
Packit 1ac44c
4.8 Limitations
Packit 1ac44c
===============
Packit 1ac44c
Packit 1ac44c
Justifications (‘^J’) are not yet covered by the general undo system.
Packit 1ac44c
So after a justification that is not immediately undone, earlier edits
Packit 1ac44c
cannot be undone any more.  The workaround is, of course, to exit
Packit 1ac44c
without saving.
Packit 1ac44c
Packit 1ac44c
   The recording and playback of keyboard macros works correctly only on
Packit 1ac44c
a terminal emulator, not on a Linux console (VT), because the latter
Packit 1ac44c
does not by default distinguish modified from unmodified arrow keys.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Built-in Help,  Next: Feature Toggles,  Prev: Editor Basics,  Up: Top
Packit 1ac44c
Packit 1ac44c
5 Built-in Help
Packit 1ac44c
***************
Packit 1ac44c
Packit 1ac44c
The built-in help system in ‘nano’ is available by pressing ‘^G’.  It is
Packit 1ac44c
fairly self-explanatory.  It documents the various parts of the editor
Packit 1ac44c
and the available keystrokes.  Navigation is via the ‘^Y’ (Page Up) and
Packit 1ac44c
‘^V’ (Page Down) keys.  ‘^X’ exits from the help system.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Feature Toggles,  Next: Nanorc Files,  Prev: Built-in Help,  Up: Top
Packit 1ac44c
Packit 1ac44c
6 Feature Toggles
Packit 1ac44c
*****************
Packit 1ac44c
Packit 1ac44c
Toggles allow you to change on-the-fly certain aspects of the editor
Packit 1ac44c
which would normally be specified via command-line options.  They are
Packit 1ac44c
invoked via Meta-key sequences (*note Commands:: for more info).  The
Packit 1ac44c
following global toggles are available:
Packit 1ac44c
Packit 1ac44c
‘Backup Files’
Packit 1ac44c
     ‘Meta-B’ toggles the ‘-B’ (‘--backup’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Constant Cursor Position Display’
Packit 1ac44c
     ‘Meta-C’ toggles the ‘-c’ (‘--constantshow’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Multiple File Buffers’
Packit 1ac44c
     ‘Meta-F’ toggles the ‘-F’ (‘--multibuffer’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Smart Home Key’
Packit 1ac44c
     ‘Meta-H’ toggles the ‘-A’ (‘--smarthome’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Auto Indent’
Packit 1ac44c
     ‘Meta-I’ toggles the ‘-i’ (‘--autoindent’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Cut From Cursor To End-of-Line’
Packit 1ac44c
     ‘Meta-K’ toggles the ‘-k’ (‘--cutfromcursor’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Long-Line Wrapping’
Packit 1ac44c
     ‘Meta-L’ toggles the ‘-w’ (‘--nowrap’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Mouse Support’
Packit 1ac44c
     ‘Meta-M’ toggles the ‘-m’ (‘--mouse’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘No Conversion From DOS/Mac Format’
Packit 1ac44c
     ‘Meta-N’ toggles the ‘-N’ (‘--noconvert’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘More Space For Editing’
Packit 1ac44c
     ‘Meta-O’ toggles the ‘-O’ (‘--morespace’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Whitespace Display’
Packit 1ac44c
     ‘Meta-P’ toggles the displaying of whitespace (*note Whitespace::).
Packit 1ac44c
Packit 1ac44c
‘Tabs To Spaces’
Packit 1ac44c
     ‘Meta-Q’ toggles the ‘-E’ (‘--tabstospaces’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Smooth Scrolling’
Packit 1ac44c
     ‘Meta-S’ toggles the ‘-S’ (‘--smooth’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Expert/No Help’
Packit 1ac44c
     ‘Meta-X’ toggles the ‘-x’ (‘--nohelp’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Color Syntax Highlighting’
Packit 1ac44c
     ‘Meta-Y’ toggles color syntax highlighting (if your nanorc defines
Packit 1ac44c
     syntaxes — *note Syntax Highlighting::).
Packit 1ac44c
Packit 1ac44c
‘Suspension’
Packit 1ac44c
     ‘Meta-Z’ toggles the ‘-z’ (‘--suspend’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Line Numbers’
Packit 1ac44c
     ‘Meta-#’ toggles the ‘-l’ (‘--linenumbers’) command-line option.
Packit 1ac44c
Packit 1ac44c
‘Soft Wrapping’
Packit 1ac44c
     ‘Meta-$’ toggles the ‘-$’ (‘--softwrap’) command-line option.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Nanorc Files,  Next: The File Browser,  Prev: Feature Toggles,  Up: Top
Packit 1ac44c
Packit 1ac44c
7 Nanorc Files
Packit 1ac44c
**************
Packit 1ac44c
Packit 1ac44c
The nanorc files contain the default settings for ‘nano’.  They should
Packit 1ac44c
be in Unix format, not in DOS or Mac format.  During startup, ‘nano’
Packit 1ac44c
will first read the system-wide settings, from /etc/nanorc (the exact
Packit 1ac44c
path might be different), and then the user-specific settings, either
Packit 1ac44c
from ‘~/.nanorc’ or from ‘$XDG_CONFIG_HOME/nano/nanorc’ or from
Packit 1ac44c
‘.config/nano/nanorc’, whichever exists first.
Packit 1ac44c
Packit 1ac44c
   A nanorc file accepts a series of "set" and "unset" commands, which
Packit 1ac44c
can be used to configure ‘nano’ on startup without using command-line
Packit 1ac44c
options.  Additionally, there are some commands to define syntax
Packit 1ac44c
highlighting and to rebind keys — *note Syntax Highlighting:: and *note
Packit 1ac44c
Rebinding Keys::.  ‘nano’ will read one command per line.
Packit 1ac44c
Packit 1ac44c
   Options in nanorc files take precedence over ‘nano’’s defaults, and
Packit 1ac44c
command-line options override nanorc settings.  Also, options that do
Packit 1ac44c
not take an argument are unset by default.  So using the ‘unset’ command
Packit 1ac44c
is only needed when wanting to override a setting of the system’s nanorc
Packit 1ac44c
file in your own nanorc.  Options that take an argument cannot be unset.
Packit 1ac44c
Packit 1ac44c
   Quotes inside string parameters don’t have to be escaped with
Packit 1ac44c
backslashes.  The last double quote in the string will be treated as its
Packit 1ac44c
end.  For example, for the ‘brackets’ option, ""')>]}" will match ‘"’,
Packit 1ac44c
‘'’, ‘)’, ‘>’, ‘]’, and ‘}’.
Packit 1ac44c
Packit 1ac44c
* Menu:
Packit 1ac44c
Packit 1ac44c
* Settings::
Packit 1ac44c
* Syntax Highlighting::
Packit 1ac44c
* Rebinding Keys::
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Settings,  Next: Syntax Highlighting,  Up: Nanorc Files
Packit 1ac44c
Packit 1ac44c
7.1 Settings
Packit 1ac44c
============
Packit 1ac44c
Packit 1ac44c
The supported settings in a nanorc file are:
Packit 1ac44c
Packit 1ac44c
‘set afterends’
Packit 1ac44c
     Make Ctrl+Right stop at word ends instead of beginnings.
Packit 1ac44c
Packit 1ac44c
‘set allow_insecure_backup’
Packit 1ac44c
     When backing up files, allow the backup to succeed even if its
Packit 1ac44c
     permissions can’t be (re)set due to special OS considerations.  You
Packit 1ac44c
     should NOT enable this option unless you are sure you need it.
Packit 1ac44c
Packit 1ac44c
‘set atblanks’
Packit 1ac44c
     When soft line wrapping is enabled, make it wrap lines at blank
Packit 1ac44c
     characters (tabs and spaces) instead of always at the edge of the
Packit 1ac44c
     screen.
Packit 1ac44c
Packit 1ac44c
‘set autoindent’
Packit 1ac44c
     Automatically indent a newly created line to the same number of
Packit 1ac44c
     tabs and/or spaces as the previous line (or as the next line if the
Packit 1ac44c
     previous line is the beginning of a paragraph).
Packit 1ac44c
Packit 1ac44c
‘set backup’
Packit 1ac44c
     When saving a file, back up the previous version of it, using the
Packit 1ac44c
     current filename suffixed with a tilde (‘~’).
Packit 1ac44c
Packit 1ac44c
‘set backupdir "DIRECTORY"’
Packit 1ac44c
     Make and keep not just one backup file, but make and keep a
Packit 1ac44c
     uniquely numbered one every time a file is saved — when backups are
Packit 1ac44c
     enabled with ‘set backup’ or ‘--backup’ or ‘-B’.  The uniquely
Packit 1ac44c
     numbered files are stored in the specified directory.
Packit 1ac44c
Packit 1ac44c
‘set backwards’
Packit 1ac44c
     Obsolete option.  Recognized but ignored.  ‘^Q’ is available to
Packit 1ac44c
     start a backward search.
Packit 1ac44c
Packit 1ac44c
‘set boldtext’
Packit 1ac44c
     Use bold instead of reverse video for the title bar, status bar,
Packit 1ac44c
     key combos, function tags, line numbers, and selected text.  This
Packit 1ac44c
     can be overridden by setting the options ‘titlecolor’,
Packit 1ac44c
     ‘statuscolor’, ‘keycolor’, ‘functioncolor’, ‘numbercolor’, and
Packit 1ac44c
     ‘selectedcolor’.
Packit 1ac44c
Packit 1ac44c
‘set brackets "STRING"’
Packit 1ac44c
     Set the characters treated as closing brackets when justifying
Packit 1ac44c
     paragraphs.  This may not include blank characters.  Only closing
Packit 1ac44c
     punctuation (see ‘set punct’), optionally followed by the specified
Packit 1ac44c
     closing brackets, can end sentences.  The default value is
Packit 1ac44c
     ""')>]}".
Packit 1ac44c
Packit 1ac44c
‘set casesensitive’
Packit 1ac44c
     Do case-sensitive searches by default.
Packit 1ac44c
Packit 1ac44c
‘set constantshow’
Packit 1ac44c
     Constantly display the cursor position on the status bar.  Note
Packit 1ac44c
     that this overrides ‘quickblank’.
Packit 1ac44c
Packit 1ac44c
‘set cutfromcursor’
Packit 1ac44c
     Use cut-from-cursor-to-end-of-line by default, instead of cutting
Packit 1ac44c
     the whole line.  (The old form of this option, ‘set cut’, is
Packit 1ac44c
     deprecated.)
Packit 1ac44c
Packit 1ac44c
‘set errorcolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for the status bar when an error message
Packit 1ac44c
     is displayed.  *Note set functioncolor:: for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set fill NUMBER’
Packit 1ac44c
     Hard-wrap lines at column number NUMBER.  If NUMBER is 0 or less,
Packit 1ac44c
     the maximum line length will be the screen width less NUMBER
Packit 1ac44c
     columns.  The default value is -8.  This option conflicts with
Packit 1ac44c
     ‘nowrap’; the last one given takes effect.
Packit 1ac44c
Packit 1ac44c
‘set functioncolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for the concise function descriptions in
Packit 1ac44c
     the two help lines at the bottom of the screen.  Valid names for
Packit 1ac44c
     foreground and background color are: ‘white’, ‘black’, ‘blue’,
Packit 1ac44c
     ‘green’, ‘red’, ‘cyan’, ‘yellow’, ‘magenta’, and ‘normal’ — where
Packit 1ac44c
     ‘normal’ means the default foreground or background color.  The
Packit 1ac44c
     name of the foreground color may be prefixed with ‘bright’.  And
Packit 1ac44c
     either FGCOLOR or ,BGCOLOR may be left out.
Packit 1ac44c
Packit 1ac44c
‘set historylog’
Packit 1ac44c
     Save the last hundred search strings and replacement strings and
Packit 1ac44c
     executed commands, so they can be easily reused in later sessions.
Packit 1ac44c
Packit 1ac44c
‘set keycolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for the shortcut key combos in the two
Packit 1ac44c
     help lines at the bottom of the screen.  *Note set functioncolor::
Packit 1ac44c
     for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set linenumbers’
Packit 1ac44c
     Display line numbers to the left of the text area.
Packit 1ac44c
Packit 1ac44c
‘set locking’
Packit 1ac44c
     Enable vim-style lock-files for when editing files.
Packit 1ac44c
Packit 1ac44c
‘set matchbrackets "STRING"’
Packit 1ac44c
     Set the opening and closing brackets that can be found by bracket
Packit 1ac44c
     searches.  This may not include blank characters.  The opening set
Packit 1ac44c
     must come before the closing set, and the two sets must be in the
Packit 1ac44c
     same order.  The default value is "(<[{)>]}".
Packit 1ac44c
Packit 1ac44c
‘set morespace’
Packit 1ac44c
     Use the blank line below the title bar as extra editing space.
Packit 1ac44c
Packit 1ac44c
‘set mouse’
Packit 1ac44c
     Enable mouse support, so that mouse clicks can be used to place the
Packit 1ac44c
     cursor, set the mark (with a double click), or execute shortcuts.
Packit 1ac44c
Packit 1ac44c
‘set multibuffer’
Packit 1ac44c
     When reading in a file with ‘^R’, insert it into a new buffer by
Packit 1ac44c
     default.
Packit 1ac44c
Packit 1ac44c
‘set noconvert’
Packit 1ac44c
     Don’t convert files from DOS/Mac format.
Packit 1ac44c
Packit 1ac44c
‘set nohelp’
Packit 1ac44c
     Don’t display the help lists at the bottom of the screen.
Packit 1ac44c
Packit 1ac44c
‘set nonewlines’
Packit 1ac44c
     When a file does not end with a newline, don’t automatically add
Packit 1ac44c
     one.
Packit 1ac44c
Packit 1ac44c
‘set nopauses’
Packit 1ac44c
     Don’t pause between warnings at startup.  This means that only the
Packit 1ac44c
     last one will be visible (when there are multiple ones).
Packit 1ac44c
Packit 1ac44c
‘set nowrap’
Packit 1ac44c
     Don’t hard-wrap text at all.  This option conflicts with ‘fill’;
Packit 1ac44c
     the last one given takes effect.
Packit 1ac44c
Packit 1ac44c
‘set numbercolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for line numbers.  *Note set
Packit 1ac44c
     functioncolor:: for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set operatingdir "DIRECTORY"’
Packit 1ac44c
     ‘nano’ will only read and write files inside "directory" and its
Packit 1ac44c
     subdirectories.  Also, the current directory is changed to here, so
Packit 1ac44c
     files are inserted from this directory.  By default, the operating
Packit 1ac44c
     directory feature is turned off.
Packit 1ac44c
Packit 1ac44c
‘set positionlog’
Packit 1ac44c
     Save the cursor position of files between editing sessions.  The
Packit 1ac44c
     cursor position is remembered for the 200 most-recently edited
Packit 1ac44c
     files.
Packit 1ac44c
Packit 1ac44c
‘set preserve’
Packit 1ac44c
     Preserve the XON and XOFF keys (‘^Q’ and ‘^S’).
Packit 1ac44c
Packit 1ac44c
‘set punct "STRING"’
Packit 1ac44c
     Set the characters treated as closing punctuation when justifying
Packit 1ac44c
     paragraphs.  This may not include blank characters.  Only the
Packit 1ac44c
     specified closing punctuation, optionally followed by closing
Packit 1ac44c
     brackets (see ‘set brackets’), can end sentences.  The default
Packit 1ac44c
     value is "!.?".
Packit 1ac44c
Packit 1ac44c
‘set quickblank’
Packit 1ac44c
     Do quick status-bar blanking: status-bar messages will disappear
Packit 1ac44c
     after 1 keystroke instead of 25.  Note that ‘constantshow’
Packit 1ac44c
     overrides this.
Packit 1ac44c
Packit 1ac44c
‘set quiet’
Packit 1ac44c
     Obsolete option.  Recognized but ignored.
Packit 1ac44c
Packit 1ac44c
‘set quotestr "REGEX"’
Packit 1ac44c
     The email-quote string, used to justify email-quoted paragraphs.
Packit 1ac44c
     This is an extended regular expression.  The default value is
Packit 1ac44c
     "^([ \t]*([#:>|}]|//))+".  Note that ‘\t’ stands for a literal Tab
Packit 1ac44c
     character.
Packit 1ac44c
Packit 1ac44c
‘set rebinddelete’
Packit 1ac44c
     Interpret the Delete key differently so that both Backspace and
Packit 1ac44c
     Delete work properly.  You should only need to use this option if
Packit 1ac44c
     Backspace acts like Delete on your system.
Packit 1ac44c
Packit 1ac44c
‘set rebindkeypad’
Packit 1ac44c
     Interpret the numeric keypad keys so that they all work properly.
Packit 1ac44c
     You should only need to use this option if they don’t, as mouse
Packit 1ac44c
     support won’t work properly with this option enabled.
Packit 1ac44c
Packit 1ac44c
‘set regexp’
Packit 1ac44c
     Do extended regular expression searches by default.
Packit 1ac44c
Packit 1ac44c
‘set selectedcolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for selected text.  *Note set
Packit 1ac44c
     functioncolor:: for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set showcursor’
Packit 1ac44c
     Put the cursor on the highlighted item in the file browser, to aid
Packit 1ac44c
     braille users.
Packit 1ac44c
Packit 1ac44c
‘set smarthome’
Packit 1ac44c
     Make the Home key smarter.  When Home is pressed anywhere but at
Packit 1ac44c
     the very beginning of non-whitespace characters on a line, the
Packit 1ac44c
     cursor will jump to that beginning (either forwards or backwards).
Packit 1ac44c
     If the cursor is already at that position, it will jump to the true
Packit 1ac44c
     beginning of the line.
Packit 1ac44c
Packit 1ac44c
‘set smooth’
Packit 1ac44c
     Use smooth scrolling by default.
Packit 1ac44c
Packit 1ac44c
‘set softwrap’
Packit 1ac44c
     Enable soft line wrapping for easier viewing of very long lines.
Packit 1ac44c
Packit 1ac44c
‘set speller "PROGRAM"’
Packit 1ac44c
     Use the given program to do spell checking and correcting.  *Note
Packit 1ac44c
     --speller:: for details.
Packit 1ac44c
Packit 1ac44c
‘set statuscolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for the status bar.  *Note set
Packit 1ac44c
     functioncolor:: for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set suspend’
Packit 1ac44c
     Allow ‘nano’ to be suspended.
Packit 1ac44c
Packit 1ac44c
‘set tabsize NUMBER’
Packit 1ac44c
     Use a tab size of NUMBER columns.  The value of NUMBER must be
Packit 1ac44c
     greater than 0.  The default value is 8.
Packit 1ac44c
Packit 1ac44c
‘set tabstospaces’
Packit 1ac44c
     Convert typed tabs to spaces.
Packit 1ac44c
Packit 1ac44c
‘set tempfile’
Packit 1ac44c
     Save automatically on exit, don’t prompt.
Packit 1ac44c
Packit 1ac44c
‘set titlecolor FGCOLOR,BGCOLOR’
Packit 1ac44c
     Use this color combination for the title bar.  *Note set
Packit 1ac44c
     functioncolor:: for valid color names.
Packit 1ac44c
Packit 1ac44c
‘set trimblanks’
Packit 1ac44c
     Remove trailing whitespace from wrapped lines when automatic
Packit 1ac44c
     hard-wrapping occurs or when text is justified.  (The old form of
Packit 1ac44c
     this option, ‘set justifytrim’, is deprecated.)
Packit 1ac44c
Packit 1ac44c
‘set unix’
Packit 1ac44c
     Save a file by default in Unix format.  This overrides nano’s
Packit 1ac44c
     default behavior of saving a file in the format that it had.  (This
Packit 1ac44c
     option has no effect when you also use ‘set noconvert’.)
Packit 1ac44c
Packit 1ac44c
‘set view’
Packit 1ac44c
     Disallow file modification.
Packit 1ac44c
Packit 1ac44c
‘set whitespace "STRING"’
Packit 1ac44c
     Set the two characters used to indicate the presence of tabs and
Packit 1ac44c
     spaces.  They must be single-column characters.  The default pair
Packit 1ac44c
     for a UTF-8 locale is "»·", and for other locales ">.".
Packit 1ac44c
Packit 1ac44c
‘set wordbounds’
Packit 1ac44c
     Detect word boundaries differently by treating punctuation
Packit 1ac44c
     characters as part of a word.
Packit 1ac44c
Packit 1ac44c
‘set wordchars "STRING"’
Packit 1ac44c
     Specify which other characters (besides the normal alphanumeric
Packit 1ac44c
     ones) should be considered as parts of words.  This overrides the
Packit 1ac44c
     option ‘wordbounds’.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Syntax Highlighting,  Next: Rebinding Keys,  Prev: Settings,  Up: Nanorc Files
Packit 1ac44c
Packit 1ac44c
7.2 Syntax Highlighting
Packit 1ac44c
=======================
Packit 1ac44c
Packit 1ac44c
Coloring the different syntactic elements of a file is done via regular
Packit 1ac44c
expressions (see the ‘color’ command below).  This is inherently
Packit 1ac44c
imperfect, because regular expressions are not powerful enough to fully
Packit 1ac44c
parse a file.  Nevertheless, regular expressions can do a lot and are
Packit 1ac44c
easy to make, so they are a good fit for a small editor like ‘nano’.
Packit 1ac44c
Packit 1ac44c
   A separate syntax can be defined for each kind of file via the
Packit 1ac44c
following commands in a nanorc file:
Packit 1ac44c
Packit 1ac44c
‘syntax NAME ["FILEREGEX" ...]’
Packit 1ac44c
     Start the definition of a syntax with this NAME.  All subsequent
Packit 1ac44c
     ‘color’ and other such commands will be added to this syntax, until
Packit 1ac44c
     a new ‘syntax’ command is encountered.
Packit 1ac44c
Packit 1ac44c
     When ‘nano’ is run, this syntax will be automatically activated if
Packit 1ac44c
     the current filename matches the extended regular expression
Packit 1ac44c
     FILEREGEX.  Or the syntax can be explicitly activated by using the
Packit 1ac44c
     ‘-Y’ or ‘--syntax’ command-line option followed by the NAME.
Packit 1ac44c
Packit 1ac44c
     The ‘default’ syntax is special: it takes no FILEREGEX, and applies
Packit 1ac44c
     to files that don’t match any syntax’s FILEREGEX.  The ‘none’
Packit 1ac44c
     syntax is reserved; specifying it on the command line is the same
Packit 1ac44c
     as not having a syntax at all.
Packit 1ac44c
Packit 1ac44c
‘header "REGEX" ...’
Packit 1ac44c
     If from all defined syntaxes no FILEREGEX matched, then compare
Packit 1ac44c
     this REGEX (or regexes) against the first line of the current file,
Packit 1ac44c
     to determine whether this syntax should be used for it.
Packit 1ac44c
Packit 1ac44c
‘magic "REGEX" ...’
Packit 1ac44c
     If no FILEREGEX matched and no ‘header’ regex matched either, then
Packit 1ac44c
     compare this REGEX (or regexes) against the result of querying the
Packit 1ac44c
     ‘magic’ database about the current file, to determine whether this
Packit 1ac44c
     syntax should be used for it.  (This functionality only works when
Packit 1ac44c
     ‘libmagic’ is installed on the system and will be silently ignored
Packit 1ac44c
     otherwise.)
Packit 1ac44c
Packit 1ac44c
‘linter PROGRAM [ARG ...]’
Packit 1ac44c
     Use the given PROGRAM to do a syntax check on the current buffer.
Packit 1ac44c
     (This overrides the speller function.)
Packit 1ac44c
Packit 1ac44c
‘formatter PROGRAM [ARG ...]’
Packit 1ac44c
     Use the given PROGRAM to automatically reformat the text in the
Packit 1ac44c
     current buffer — useful for a programming language like Go.  (This
Packit 1ac44c
     overrides the speller and linter functions.)
Packit 1ac44c
Packit 1ac44c
‘comment "STRING"’
Packit 1ac44c
     Use the given string for commenting and uncommenting lines.  If the
Packit 1ac44c
     string contains a vertical bar or pipe character (|), this
Packit 1ac44c
     designates bracket-style comments; for example, "/*|*/" for CSS
Packit 1ac44c
     files.  The characters before the pipe are prepended to the line
Packit 1ac44c
     and the characters after the pipe are appended at the end of the
Packit 1ac44c
     line.  If no pipe character is present, the full string is
Packit 1ac44c
     prepended; for example, "#" for Python files.  If empty double
Packit 1ac44c
     quotes are specified, the comment/uncomment functions are disabled;
Packit 1ac44c
     for example, "" for JSON. The default value is "#".
Packit 1ac44c
Packit 1ac44c
‘color FGCOLOR,BGCOLOR "REGEX" ...’
Packit 1ac44c
     Display all pieces of text that match the extended regular
Packit 1ac44c
     expression "regex" with foreground color "fgcolor" and background
Packit 1ac44c
     color "bgcolor", at least one of which must be specified.  Valid
Packit 1ac44c
     colors for foreground and background are: white, black, red, blue,
Packit 1ac44c
     green, yellow, magenta, and cyan.  You may use the prefix "bright"
Packit 1ac44c
     to get a stronger color highlight for the foreground.  If your
Packit 1ac44c
     terminal supports transparency, not specifying a "bgcolor" tells
Packit 1ac44c
     ‘nano’ to attempt to use a transparent background.
Packit 1ac44c
Packit 1ac44c
‘icolor FGCOLOR,BGCOLOR "REGEX" ...’
Packit 1ac44c
     Same as above, except that the matching is case insensitive.
Packit 1ac44c
Packit 1ac44c
‘color FGCOLOR,BGCOLOR start="FROMRX" end="TORX"’
Packit 1ac44c
     Display all pieces of text whose start matches extended regular
Packit 1ac44c
     expression "fromrx" and whose end matches extended regular
Packit 1ac44c
     expression "torx" with foreground color "fgcolor" and background
Packit 1ac44c
     color "bgcolor", at least one of which must be specified.  This
Packit 1ac44c
     means that, after an initial instance of "fromrx", all text until
Packit 1ac44c
     the first instance of "torx" will be colored.  This allows syntax
Packit 1ac44c
     highlighting to span multiple lines.
Packit 1ac44c
Packit 1ac44c
‘icolor FGCOLOR,BGCOLOR start="FROMRX" end="TORX"’
Packit 1ac44c
     Same as above, except that the matching is case insensitive.
Packit 1ac44c
Packit 1ac44c
‘include "SYNTAXFILE"’
Packit 1ac44c
     Read in self-contained color syntaxes from "syntaxfile".  Note that
Packit 1ac44c
     "syntaxfile" may contain only the above commands, from ‘syntax’ to
Packit 1ac44c
     ‘icolor’.
Packit 1ac44c
Packit 1ac44c
‘extendsyntax NAME COMMAND [ARG ...]’
Packit 1ac44c
     Extend the syntax previously defined as "NAME" with another
Packit 1ac44c
     COMMAND.  This allows you to add a new ‘color’, ‘icolor’, ‘header’,
Packit 1ac44c
     ‘magic’, ‘comment’, ‘linter’, or ‘formatter’ command to an already
Packit 1ac44c
     defined syntax — useful when you want to slightly improve a syntax
Packit 1ac44c
     defined in one of the system-installed files (which normally are
Packit 1ac44c
     not writable).
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Rebinding Keys,  Prev: Syntax Highlighting,  Up: Nanorc Files
Packit 1ac44c
Packit 1ac44c
7.3 Rebinding Keys
Packit 1ac44c
==================
Packit 1ac44c
Packit 1ac44c
Key bindings can be changed via the following three commands in a nanorc
Packit 1ac44c
file:
Packit 1ac44c
Packit 1ac44c
‘bind key function menu’
Packit 1ac44c
     Rebinds ‘key’ to ‘function’ in the context of ‘menu’ (or in all
Packit 1ac44c
     menus where the function exists by using ‘all’).
Packit 1ac44c
Packit 1ac44c
‘bind key "string" menu’
Packit 1ac44c
     Makes ‘key’ produce ‘string’ in the context of ‘menu’ (or in all
Packit 1ac44c
     menus where the key exists when ‘all’ is used).  The ‘string’ can
Packit 1ac44c
     consist of text or commands or a mix of them.  (To enter a command
Packit 1ac44c
     into the ‘string’, precede its keystroke with ‘M-V’.)
Packit 1ac44c
Packit 1ac44c
‘unbind key menu’
Packit 1ac44c
     Unbinds ‘key’ from ‘menu’ (or from all menus where it exists by
Packit 1ac44c
     using ‘all’).
Packit 1ac44c
Packit 1ac44c
Packit 1ac44c
   The format of ‘key’ should be one of:
Packit 1ac44c
Packit 1ac44c
     ‘^’  followed by an ASCII character or the word "Space".  Example:
Packit 1ac44c
     ‘^C’.
Packit 1ac44c
Packit 1ac44c
     ‘M-’  followed by a ASCII character or the word "Space".  Example:
Packit 1ac44c
     ‘M-C’.
Packit 1ac44c
Packit 1ac44c
     ‘F’  followed by a numeric value from 1 to 16.  Example: ‘F10’.
Packit 1ac44c
Packit 1ac44c
Packit 1ac44c
   Valid names for the ‘function’ to be bound are:
Packit 1ac44c
Packit 1ac44c
‘help’
Packit 1ac44c
     Invokes the help viewer.
Packit 1ac44c
Packit 1ac44c
‘cancel’
Packit 1ac44c
     Cancels the current command.
Packit 1ac44c
Packit 1ac44c
‘exit’
Packit 1ac44c
     Exits from the program (or from the help viewer or the file
Packit 1ac44c
     browser).
Packit 1ac44c
Packit 1ac44c
‘writeout’
Packit 1ac44c
     Writes the current buffer to disk, asking for a name.
Packit 1ac44c
Packit 1ac44c
‘savefile’
Packit 1ac44c
     Writes the current file to disk without prompting.
Packit 1ac44c
Packit 1ac44c
‘insert’
Packit 1ac44c
     Inserts a file into the current buffer (at the current cursor
Packit 1ac44c
     position), or into a new buffer when option ‘multibuffer’ is set.
Packit 1ac44c
Packit 1ac44c
‘whereis’
Packit 1ac44c
     Starts a forward search for text in the current buffer — or for
Packit 1ac44c
     filenames matching a string in the current list in the file
Packit 1ac44c
     browser.
Packit 1ac44c
Packit 1ac44c
‘wherewas’
Packit 1ac44c
     Starts a backward search for text in the current buffer.
Packit 1ac44c
Packit 1ac44c
‘searchagain’
Packit 1ac44c
     Repeats the last search command without prompting.
Packit 1ac44c
Packit 1ac44c
‘findprevious’
Packit 1ac44c
     As ‘searchagain’, but always in the backward direction.
Packit 1ac44c
Packit 1ac44c
‘findnext’
Packit 1ac44c
     As ‘searchagain’, but always in the forward direction.
Packit 1ac44c
Packit 1ac44c
‘replace’
Packit 1ac44c
     Interactively replaces text within the current buffer.
Packit 1ac44c
Packit 1ac44c
‘cut’
Packit 1ac44c
     Cuts and stores the current line (or the marked region).
Packit 1ac44c
Packit 1ac44c
‘copytext’
Packit 1ac44c
     Copies the current line (or the marked region) without deleting it.
Packit 1ac44c
Packit 1ac44c
‘uncut’
Packit 1ac44c
     Copies the currently stored text into the current buffer at the
Packit 1ac44c
     current cursor position.
Packit 1ac44c
Packit 1ac44c
‘mark’
Packit 1ac44c
     Sets the mark at the current position, to start selecting text.
Packit 1ac44c
Packit 1ac44c
‘cutwordleft’
Packit 1ac44c
     Cuts from the cursor position to the beginning of the preceding
Packit 1ac44c
     word.
Packit 1ac44c
Packit 1ac44c
‘cutwordright’
Packit 1ac44c
     Cuts from the cursor position to the beginning of the next word.
Packit 1ac44c
Packit 1ac44c
‘cutrestoffile’
Packit 1ac44c
     Cuts all text from the cursor position till the end of the buffer.
Packit 1ac44c
Packit 1ac44c
‘curpos’
Packit 1ac44c
     Shows the current cursor position: the line, column, and character
Packit 1ac44c
     positions.
Packit 1ac44c
Packit 1ac44c
‘wordcount’
Packit 1ac44c
     Counts the number of words, lines and characters in the current
Packit 1ac44c
     buffer.
Packit 1ac44c
Packit 1ac44c
‘speller’
Packit 1ac44c
     Invokes a spell-checking program (or linting program, or formatter
Packit 1ac44c
     program, if the active syntax defines such a thing).
Packit 1ac44c
Packit 1ac44c
‘justify’
Packit 1ac44c
     Justifies the current paragraph.  A paragraph is a group of
Packit 1ac44c
     contiguous lines that, apart from possibly the first line, all have
Packit 1ac44c
     the same indentation.  The beginning of a paragraph is detected by
Packit 1ac44c
     either this lone line with a differing indentation or by a
Packit 1ac44c
     preceding blank line.
Packit 1ac44c
Packit 1ac44c
‘fulljustify’
Packit 1ac44c
     Justifies the entire current buffer.
Packit 1ac44c
Packit 1ac44c
‘indent’
Packit 1ac44c
     Indents (shifts to the right) the currently marked text.
Packit 1ac44c
Packit 1ac44c
‘unindent’
Packit 1ac44c
     Unindents (shifts to the left) the currently marked text.
Packit 1ac44c
Packit 1ac44c
‘comment’
Packit 1ac44c
     Comments or uncomments the current line or marked lines, using the
Packit 1ac44c
     comment style specified in the active syntax.
Packit 1ac44c
Packit 1ac44c
‘complete’
Packit 1ac44c
     Completes the fragment before the cursor to a full word found
Packit 1ac44c
     elsewhere in the current buffer.
Packit 1ac44c
Packit 1ac44c
‘left’
Packit 1ac44c
     Goes left one position (in the editor or browser).
Packit 1ac44c
Packit 1ac44c
‘right’
Packit 1ac44c
     Goes right one position (in the editor or browser).
Packit 1ac44c
Packit 1ac44c
‘up’
Packit 1ac44c
     Goes one line up (in the editor or browser).
Packit 1ac44c
Packit 1ac44c
‘down’
Packit 1ac44c
     Goes one line down (in the editor or browser).
Packit 1ac44c
Packit 1ac44c
‘scrollup’
Packit 1ac44c
     Scrolls the viewport up one row (meaning that the text slides down)
Packit 1ac44c
     while keeping the cursor in the same text position, if possible.
Packit 1ac44c
Packit 1ac44c
‘scrolldown’
Packit 1ac44c
     Scrolls the viewport down one row (meaning that the text slides up)
Packit 1ac44c
     while keeping the cursor in the same text position, if possible.
Packit 1ac44c
Packit 1ac44c
‘prevword’
Packit 1ac44c
     Moves the cursor to the beginning of the previous word.
Packit 1ac44c
Packit 1ac44c
‘nextword’
Packit 1ac44c
     Moves the cursor to the beginning of the next word.
Packit 1ac44c
Packit 1ac44c
‘home’
Packit 1ac44c
     Moves the cursor to the beginning of the current line.
Packit 1ac44c
Packit 1ac44c
‘end’
Packit 1ac44c
     Moves the cursor to the end of the current line.
Packit 1ac44c
Packit 1ac44c
‘beginpara’
Packit 1ac44c
     Moves the cursor to the beginning of the current paragraph.
Packit 1ac44c
Packit 1ac44c
‘endpara’
Packit 1ac44c
     Moves the cursor to the end of the current paragraph.
Packit 1ac44c
Packit 1ac44c
‘prevblock’
Packit 1ac44c
     Moves the cursor to the beginning of the current or preceding block
Packit 1ac44c
     of text.  (Blocks are separated by one or more blank lines.)
Packit 1ac44c
Packit 1ac44c
‘nextblock’
Packit 1ac44c
     Moves the cursor to the beginning of the next block of text.
Packit 1ac44c
Packit 1ac44c
‘pageup’
Packit 1ac44c
     Goes up one screenful.
Packit 1ac44c
Packit 1ac44c
‘pagedown’
Packit 1ac44c
     Goes down one screenful.
Packit 1ac44c
Packit 1ac44c
‘firstline’
Packit 1ac44c
     Goes to the first line of the file.
Packit 1ac44c
Packit 1ac44c
‘lastline’
Packit 1ac44c
     Goes to the last line of the file.
Packit 1ac44c
Packit 1ac44c
‘gotoline’
Packit 1ac44c
     Goes to a specific line (and column if specified).  Negative
Packit 1ac44c
     numbers count from the end of the file (and end of the line).
Packit 1ac44c
Packit 1ac44c
‘findbracket’
Packit 1ac44c
     Moves the cursor to the bracket (brace, parenthesis, etc.)  that
Packit 1ac44c
     matches (pairs) with the one under the cursor.
Packit 1ac44c
Packit 1ac44c
‘prevbuf’
Packit 1ac44c
     Switches to editing/viewing the previous buffer when multiple
Packit 1ac44c
     buffers are open.
Packit 1ac44c
Packit 1ac44c
‘nextbuf’
Packit 1ac44c
     Switches to editing/viewing the next buffer when multiple buffers
Packit 1ac44c
     are open.
Packit 1ac44c
Packit 1ac44c
‘verbatim’
Packit 1ac44c
     Inserts the next keystroke verbatim into the file.
Packit 1ac44c
Packit 1ac44c
‘tab’
Packit 1ac44c
     Inserts a tab at the current cursor location.
Packit 1ac44c
Packit 1ac44c
‘enter’
Packit 1ac44c
     Inserts a new line below the current one.
Packit 1ac44c
Packit 1ac44c
‘delete’
Packit 1ac44c
     Deletes the character under the cursor.
Packit 1ac44c
Packit 1ac44c
‘backspace’
Packit 1ac44c
     Deletes the character before the cursor.
Packit 1ac44c
Packit 1ac44c
‘recordmacro’
Packit 1ac44c
     Starts the recording of keystrokes — the keystrokes are stored as a
Packit 1ac44c
     macro.  When already recording, the recording is stopped.
Packit 1ac44c
Packit 1ac44c
‘runmacro’
Packit 1ac44c
     Replays the keystrokes of the last recorded macro.
Packit 1ac44c
Packit 1ac44c
‘undo’
Packit 1ac44c
     Undoes the last performed text action (add text, delete text, etc).
Packit 1ac44c
Packit 1ac44c
‘redo’
Packit 1ac44c
     Redoes the last undone action (i.e., it undoes an undo).
Packit 1ac44c
Packit 1ac44c
‘refresh’
Packit 1ac44c
     Refreshes the screen.
Packit 1ac44c
Packit 1ac44c
‘suspend’
Packit 1ac44c
     Suspends the editor (if the suspending function is enabled, see the
Packit 1ac44c
     "suspendenable" entry below).
Packit 1ac44c
Packit 1ac44c
‘casesens’
Packit 1ac44c
     Toggles case sensitivity in searching (search/replace menus only).
Packit 1ac44c
Packit 1ac44c
‘regexp’
Packit 1ac44c
     Toggles whether searching/replacing is based on literal strings or
Packit 1ac44c
     regular expressions.
Packit 1ac44c
Packit 1ac44c
‘backwards’
Packit 1ac44c
     Toggles whether searching/replacing goes forward or backward.
Packit 1ac44c
Packit 1ac44c
‘prevhistory’
Packit 1ac44c
     Shows the previous history entry in the prompt menus (e.g. search).
Packit 1ac44c
Packit 1ac44c
‘nexthistory’
Packit 1ac44c
     Shows the next history entry in the prompt menus (e.g. search).
Packit 1ac44c
Packit 1ac44c
‘flipreplace’
Packit 1ac44c
     Toggles between searching for something and replacing something.
Packit 1ac44c
Packit 1ac44c
‘flipgoto’
Packit 1ac44c
     Toggles between searching for text and targeting a line number.
Packit 1ac44c
     (The form ‘gototext’ is deprecated.)
Packit 1ac44c
Packit 1ac44c
‘flipexecute’
Packit 1ac44c
     Toggles between inserting a file and executing a command.
Packit 1ac44c
Packit 1ac44c
‘flippipe’
Packit 1ac44c
     When executing a command, toggles whether the current buffer (or
Packit 1ac44c
     marked region) is piped to the command.
Packit 1ac44c
Packit 1ac44c
‘flipnewbuffer’
Packit 1ac44c
     Toggles between inserting into the current buffer and into a new
Packit 1ac44c
     empty buffer.
Packit 1ac44c
Packit 1ac44c
‘dosformat’
Packit 1ac44c
     When writing a file, switches to writing a DOS format (CR/LF).
Packit 1ac44c
Packit 1ac44c
‘macformat’
Packit 1ac44c
     When writing a file, switches to writing a Mac format.
Packit 1ac44c
Packit 1ac44c
‘append’
Packit 1ac44c
     When writing a file, appends to the end instead of overwriting.
Packit 1ac44c
Packit 1ac44c
‘prepend’
Packit 1ac44c
     When writing a file, ’prepends’ (writes at the beginning) instead
Packit 1ac44c
     of overwriting.
Packit 1ac44c
Packit 1ac44c
‘backup’
Packit 1ac44c
     When writing a file, creates a backup of the current file.
Packit 1ac44c
Packit 1ac44c
‘discardbuffer’
Packit 1ac44c
     When about to write a file, discard the current buffer without
Packit 1ac44c
     saving.  (This function is bound by default only when option
Packit 1ac44c
     ‘--tempfile’ is in effect.)
Packit 1ac44c
Packit 1ac44c
‘browser’
Packit 1ac44c
     Starts the file browser, allowing to select a file from a list.
Packit 1ac44c
Packit 1ac44c
‘gotodir’
Packit 1ac44c
     Goes to a directory to be specified, allowing to browse anywhere in
Packit 1ac44c
     the filesystem.
Packit 1ac44c
Packit 1ac44c
‘firstfile’
Packit 1ac44c
     Goes to the first file when using the file browser (reading or
Packit 1ac44c
     writing files).
Packit 1ac44c
Packit 1ac44c
‘lastfile’
Packit 1ac44c
     Goes to the last file when using the file browser (reading or
Packit 1ac44c
     writing files).
Packit 1ac44c
Packit 1ac44c
‘nohelp’
Packit 1ac44c
     Toggles the presence of the two-line list of key bindings at the
Packit 1ac44c
     bottom of the screen.
Packit 1ac44c
Packit 1ac44c
‘constantshow’
Packit 1ac44c
     Toggles the constant display of the current line, column, and
Packit 1ac44c
     character positions.  (The form ‘constupdate’ is deprecated.)
Packit 1ac44c
Packit 1ac44c
‘morespace’
Packit 1ac44c
     Toggles the presence of the blank line that ’separates’ the title
Packit 1ac44c
     bar from the file text.
Packit 1ac44c
Packit 1ac44c
‘smoothscroll’
Packit 1ac44c
     Toggles smooth scrolling (when moving around with the arrow keys).
Packit 1ac44c
Packit 1ac44c
‘softwrap’
Packit 1ac44c
     Toggles the displaying of overlong lines on multiple screen lines.
Packit 1ac44c
Packit 1ac44c
‘linenumbers’
Packit 1ac44c
     Toggles the display of line numbers in front of the text.
Packit 1ac44c
Packit 1ac44c
‘whitespacedisplay’
Packit 1ac44c
     Toggles the showing of whitespace.
Packit 1ac44c
Packit 1ac44c
‘nosyntax’
Packit 1ac44c
     Toggles syntax highlighting.
Packit 1ac44c
Packit 1ac44c
‘smarthome’
Packit 1ac44c
     Toggles the smartness of the Home key.
Packit 1ac44c
Packit 1ac44c
‘autoindent’
Packit 1ac44c
     Toggles whether a newly created line will contain the same amount
Packit 1ac44c
     of leading whitespace as the preceding line — or as the next line
Packit 1ac44c
     if the preceding line is the beginning of a paragraph.
Packit 1ac44c
Packit 1ac44c
‘cutfromcursor’
Packit 1ac44c
     Toggles whether cutting text will cut the whole line or just from
Packit 1ac44c
     the current cursor position to the end of the line.  (The form
Packit 1ac44c
     ‘cuttoend’ is deprecated.)
Packit 1ac44c
Packit 1ac44c
‘nowrap’
Packit 1ac44c
     Toggles whether long lines will be hard-wrapped to the next line.
Packit 1ac44c
Packit 1ac44c
‘tabstospaces’
Packit 1ac44c
     Toggles whether typed tabs will be converted to spaces.
Packit 1ac44c
Packit 1ac44c
‘backupfile’
Packit 1ac44c
     Toggles whether a backup will be made of the file to be edited.
Packit 1ac44c
Packit 1ac44c
‘multibuffer’
Packit 1ac44c
     Toggles whether a file is inserted into the current buffer or read
Packit 1ac44c
     into a new buffer.
Packit 1ac44c
Packit 1ac44c
‘mouse’
Packit 1ac44c
     Toggles mouse support.
Packit 1ac44c
Packit 1ac44c
‘noconvert’
Packit 1ac44c
     Toggles automatic conversion of files from DOS/Mac format.
Packit 1ac44c
Packit 1ac44c
‘suspendenable’
Packit 1ac44c
     Toggles whether the suspend shortcut (normally ‘^Z’) will suspend
Packit 1ac44c
     the editor.
Packit 1ac44c
Packit 1ac44c
Packit 1ac44c
   Valid names for ‘menu’ are:
Packit 1ac44c
Packit 1ac44c
‘main’
Packit 1ac44c
     The main editor window where text is entered and edited.
Packit 1ac44c
Packit 1ac44c
‘search’
Packit 1ac44c
     The search menu (AKA whereis).
Packit 1ac44c
Packit 1ac44c
‘replace’
Packit 1ac44c
     The ’search to replace’ menu.
Packit 1ac44c
Packit 1ac44c
‘replacewith’
Packit 1ac44c
     The ’replace with’ menu, which comes up after ’search to replace’.
Packit 1ac44c
Packit 1ac44c
‘gotoline’
Packit 1ac44c
     The ’goto line (and column)’ menu.
Packit 1ac44c
Packit 1ac44c
‘writeout’
Packit 1ac44c
     The ’write file’ menu.
Packit 1ac44c
Packit 1ac44c
‘insert’
Packit 1ac44c
     The ’insert file’ menu.
Packit 1ac44c
Packit 1ac44c
‘extcmd’
Packit 1ac44c
     The menu for inserting output from an external command, reached
Packit 1ac44c
     from the insert menu.
Packit 1ac44c
Packit 1ac44c
‘help’
Packit 1ac44c
     The help-viewer menu.
Packit 1ac44c
Packit 1ac44c
‘spell’
Packit 1ac44c
     The interactive spell checker Yes/no menu.
Packit 1ac44c
Packit 1ac44c
‘linter’
Packit 1ac44c
     The linter menu.
Packit 1ac44c
Packit 1ac44c
‘browser’
Packit 1ac44c
     The file browser, for choosing a file to read from or write to.
Packit 1ac44c
Packit 1ac44c
‘whereisfile’
Packit 1ac44c
     The ’search for a file’ menu in the file browser.
Packit 1ac44c
Packit 1ac44c
‘gotodir’
Packit 1ac44c
     The ’go to directory’ menu in the file browser.
Packit 1ac44c
Packit 1ac44c
‘all’
Packit 1ac44c
     A special name that encompasses all menus.  For ‘bind’ it means all
Packit 1ac44c
     menus where the specified ‘function’ exists; for ‘unbind’ it means
Packit 1ac44c
     all menus where the specified ‘key’ exists.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: The File Browser,  Next: Pico Compatibility,  Prev: Nanorc Files,  Up: Top
Packit 1ac44c
Packit 1ac44c
8 The File Browser
Packit 1ac44c
******************
Packit 1ac44c
Packit 1ac44c
When in the Read-File (‘^R’) or Write-Out menu (‘^O’), pressing ‘^T’
Packit 1ac44c
will invoke the file browser.  Here, one can navigate directories in a
Packit 1ac44c
graphical manner in order to find the desired file.
Packit 1ac44c
Packit 1ac44c
   Basic movement in the file browser is accomplished with the arrow and
Packit 1ac44c
other cursor-movement keys.  More targeted movement is accomplished by
Packit 1ac44c
searching, via ‘^W’ or ‘w’, or by changing directory, via ‘^_’ or ‘g’.
Packit 1ac44c
The behavior of the ‘Enter’ key (or ‘s’) varies by what is currently
Packit 1ac44c
selected.  If the currently selected object is a directory, the file
Packit 1ac44c
browser will enter and display the contents of the directory.  If the
Packit 1ac44c
object is a file, this filename and path are copied to the status bar,
Packit 1ac44c
and the file browser exits.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Pico Compatibility,  Next: Building and Configure Options,  Prev: The File Browser,  Up: Top
Packit 1ac44c
Packit 1ac44c
9 Pico Compatibility
Packit 1ac44c
********************
Packit 1ac44c
Packit 1ac44c
‘nano’ attempts to emulate Pico as closely as possible, but there are
Packit 1ac44c
some differences between the editors:
Packit 1ac44c
Packit 1ac44c
‘Interactive Replace’
Packit 1ac44c
     Instead of allowing you to replace either just one occurrence of a
Packit 1ac44c
     search string or all of them, ‘nano’’s replace function is
Packit 1ac44c
     interactive: it will pause at each found search string and query
Packit 1ac44c
     whether to replace this instance.  You can then choose Yes, or No
Packit 1ac44c
     (skip this one), or All (don’t ask any more), or Cancel (stop with
Packit 1ac44c
     replacing).
Packit 1ac44c
Packit 1ac44c
‘Search and Replace History’
Packit 1ac44c
     When the option ‘-H’ or ‘--historylog’ is given (or set in the a
Packit 1ac44c
     nanorc file), text entered as search or replace strings is stored.
Packit 1ac44c
     These strings can be accessed with the up/down arrow keys, or you
Packit 1ac44c
     can type the first few characters and then use ‘Tab’ to cycle
Packit 1ac44c
     through the matching strings.  A retrieved string can subsequently
Packit 1ac44c
     be edited.
Packit 1ac44c
Packit 1ac44c
‘Position History’
Packit 1ac44c
     When the option ‘-P’ or ‘--positionlog’ is given (or set in a
Packit 1ac44c
     nanorc file), ‘nano’ will store the position of the cursor when you
Packit 1ac44c
     close a file, and will place the cursor in that position again when
Packit 1ac44c
     you later reopen the file.
Packit 1ac44c
Packit 1ac44c
‘Current Cursor Position’
Packit 1ac44c
     The output of the "Display Cursor Position" command (‘^C’) displays
Packit 1ac44c
     not only the current line and character position of the cursor, but
Packit 1ac44c
     also (between the two) the current column position.
Packit 1ac44c
Packit 1ac44c
‘Hard-Wrapping’
Packit 1ac44c
     By default, ‘nano’ hard-wraps lines at screen width minus eight
Packit 1ac44c
     columns, whereas Pico does it at screen width minus six columns.
Packit 1ac44c
     You can make ‘nano’ do the same as Pico by using ‘--fill=-6’.
Packit 1ac44c
Packit 1ac44c
‘Spell Checking’
Packit 1ac44c
     In the internal spell checker misspelled words are sorted
Packit 1ac44c
     alphabetically and trimmed for uniqueness, such that the words
Packit 1ac44c
     ’apple’ and ’Apple’ will be prompted for correction separately.
Packit 1ac44c
Packit 1ac44c
‘Writing Selected Text to Files’
Packit 1ac44c
     When using the Write-Out key (‘^O’), text that has been selected
Packit 1ac44c
     using the marking key (‘^^’) can not just be written out to a new
Packit 1ac44c
     (or existing) file, it can also be appended or prepended to an
Packit 1ac44c
     existing file.
Packit 1ac44c
Packit 1ac44c
‘Reading Text from a Command’
Packit 1ac44c
     When using the Read-File key (‘^R’), ‘nano’ can not just read a
Packit 1ac44c
     file, it can also read the output of a command to be run (‘^X’).
Packit 1ac44c
Packit 1ac44c
‘Reading from Working Directory’
Packit 1ac44c
     By default, Pico will read files from the user’s home directory
Packit 1ac44c
     (when using ‘^R’), but it will write files to the current working
Packit 1ac44c
     directory (when using ‘^O’).  ‘nano’ makes this symmetrical: always
Packit 1ac44c
     reading from and writing to the current working directory — the
Packit 1ac44c
     directory that ‘nano’ was started in.
Packit 1ac44c
Packit 1ac44c
‘File Browser’
Packit 1ac44c
     In the file browser, ‘nano’ does not implement the Add, Copy,
Packit 1ac44c
     Rename, and Delete commands that Pico provides.  In ‘nano’ the
Packit 1ac44c
     browser is just a file browser, not a file manager.
Packit 1ac44c
Packit 1ac44c
‘Toggles’
Packit 1ac44c
     Many options which alter the functionality of the program can be
Packit 1ac44c
     "toggled" on or off using Meta key sequences, meaning the program
Packit 1ac44c
     does not have to be restarted to turn a particular feature on or
Packit 1ac44c
     off.  *Note Feature Toggles:: for a list of options that can be
Packit 1ac44c
     toggled.  Or see the list at the end of the main internal help text
Packit 1ac44c
     (‘^G’) instead.
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
File: nano.info,  Node: Building and Configure Options,  Prev: Pico Compatibility,  Up: Top
Packit 1ac44c
Packit 1ac44c
10 Building and Configure Options
Packit 1ac44c
*********************************
Packit 1ac44c
Packit 1ac44c
Building ‘nano’ from source is fairly straightforward if you are
Packit 1ac44c
familiar with compiling programs with autoconf support:
Packit 1ac44c
Packit 1ac44c
       tar xvzf nano-x.y.z.tar.gz
Packit 1ac44c
       cd nano-x.y.z
Packit 1ac44c
       ./configure
Packit 1ac44c
       make
Packit 1ac44c
       make install
Packit 1ac44c
Packit 1ac44c
   The possible options to ‘./configure’ are:
Packit 1ac44c
Packit 1ac44c
‘--disable-browser’
Packit 1ac44c
     Disable the mini file browser that can be called with ‘^T’ when
Packit 1ac44c
     reading or writing files.
Packit 1ac44c
Packit 1ac44c
‘--disable-color’
Packit 1ac44c
     Disable support for the syntax coloring of files.  This also
Packit 1ac44c
     eliminates the ‘-Y’ command-line option, which chooses a specific
Packit 1ac44c
     syntax.
Packit 1ac44c
Packit 1ac44c
‘--disable-comment’
Packit 1ac44c
     Disable the single-keystroke comment/uncomment function (‘M-3’).
Packit 1ac44c
Packit 1ac44c
‘--disable-extra’
Packit 1ac44c
     Disable the Easter egg: a crawl of major contributors.
Packit 1ac44c
Packit 1ac44c
‘--disable-help’
Packit 1ac44c
     Disable the help function.  Doing this makes the binary much
Packit 1ac44c
     smaller, but makes it difficult for new users to learn more than
Packit 1ac44c
     very basic things about using the editor.
Packit 1ac44c
Packit 1ac44c
‘--disable-histories’
Packit 1ac44c
     Disable the code for the handling of the history files: the search
Packit 1ac44c
     and replace strings that were used, and the cursor position at
Packit 1ac44c
     which each file was closed.  This also eliminates the ‘-H’ and ‘-P’
Packit 1ac44c
     command-line options, which switch on the logging of search/replace
Packit 1ac44c
     strings and cursor positions.
Packit 1ac44c
Packit 1ac44c
‘--disable-justify’
Packit 1ac44c
     Disable the justify and unjustify functions.
Packit 1ac44c
Packit 1ac44c
‘--disable-libmagic’
Packit 1ac44c
     Disable the use of the library of magic-number tests (for
Packit 1ac44c
     determining the file type and thus which syntax to use for
Packit 1ac44c
     colouring — often the tests on filename extension and header line
Packit 1ac44c
     will be enough).
Packit 1ac44c
Packit 1ac44c
‘--disable-linenumbers’
Packit 1ac44c
     Disable the line-numbering function (‘M-#’).  This also eliminates
Packit 1ac44c
     the ‘-l’ command-line option, which turns line numbering on.
Packit 1ac44c
Packit 1ac44c
‘--disable-mouse’
Packit 1ac44c
     Disable all mouse functionality.  This also eliminates the ‘-m’
Packit 1ac44c
     command-line option, which enables the mouse functionality.
Packit 1ac44c
Packit 1ac44c
‘--disable-multibuffer’
Packit 1ac44c
     Disable support for opening multiple files at a time and switching
Packit 1ac44c
     between them on the fly.  This also eliminates the ‘-F’
Packit 1ac44c
     command-line option, which causes a file to be read into a separate
Packit 1ac44c
     buffer by default.
Packit 1ac44c
Packit 1ac44c
‘--disable-nanorc’
Packit 1ac44c
     Disable support for reading the nanorc files at startup.  With such
Packit 1ac44c
     support, you can store custom settings in a system-wide and a
Packit 1ac44c
     per-user nanorc file rather than having to pass command-line
Packit 1ac44c
     options to get the desired behavior.  *Note Nanorc Files:: for more
Packit 1ac44c
     info.  Disabling this also eliminates the ‘-I’ command-line option,
Packit 1ac44c
     which inhibits the reading of nanorc files.
Packit 1ac44c
Packit 1ac44c
‘--disable-operatingdir’
Packit 1ac44c
     Disable setting the operating directory.  This also eliminates the
Packit 1ac44c
     ‘-o’ command-line option, which sets the operating directory.
Packit 1ac44c
Packit 1ac44c
‘--disable-speller’
Packit 1ac44c
     Disable use of the spell checker.  This also eliminates the ‘-s’
Packit 1ac44c
     command-line option, which allows specifying an alternate spell
Packit 1ac44c
     checker.
Packit 1ac44c
Packit 1ac44c
‘--disable-tabcomp’
Packit 1ac44c
     Disable tab completion (when nano asks for a filename or a search
Packit 1ac44c
     string).
Packit 1ac44c
Packit 1ac44c
‘--disable-wordcomp’
Packit 1ac44c
     Disable word completion (‘^]’).
Packit 1ac44c
Packit 1ac44c
‘--disable-wrapping’
Packit 1ac44c
     Disable all hard-wrapping of overlong lines.  This also eliminates
Packit 1ac44c
     the ‘-w’ command-line option, which switches long-line wrapping
Packit 1ac44c
     off.
Packit 1ac44c
Packit 1ac44c
‘--enable-tiny’
Packit 1ac44c
     This option implies all of the above.  It also disables some other
Packit 1ac44c
     internals of the editor, like the marking code, the
Packit 1ac44c
     cut-to-end-of-line code, and the function toggles.  By using the
Packit 1ac44c
     enabling counterpart of the above options together with
Packit 1ac44c
     ‘--enable-tiny’, specific features can be switched back on — but a
Packit 1ac44c
     few cannot.
Packit 1ac44c
Packit 1ac44c
‘--enable-debug’
Packit 1ac44c
     Enable support for runtime debug output.  This can get pretty
Packit 1ac44c
     messy, so chances are you only want this feature when you’re
Packit 1ac44c
     working on the nano source.
Packit 1ac44c
Packit 1ac44c
‘--disable-nls’
Packit 1ac44c
     Disables Native Language support.  This will disable the use of any
Packit 1ac44c
     available GNU ‘nano’ translations.
Packit 1ac44c
Packit 1ac44c
‘--disable-wrapping-as-root’
Packit 1ac44c
     Disable hard-wrapping of overlong lines by default when ‘nano’ is
Packit 1ac44c
     run as root.
Packit 1ac44c
Packit 1ac44c
‘--enable-utf8’
Packit 1ac44c
     Enable support for reading and writing Unicode files.  This will
Packit 1ac44c
     require either a wide version of curses, or a UTF-8-enabled version
Packit 1ac44c
     of Slang.
Packit 1ac44c
Packit 1ac44c
‘--disable-utf8’
Packit 1ac44c
     Disable support for reading and writing Unicode files.  Normally
Packit 1ac44c
     the configure script auto-detects whether to enable UTF-8 support
Packit 1ac44c
     or not.  You can use this or the previous option to override that
Packit 1ac44c
     detection.
Packit 1ac44c
Packit 1ac44c
‘--enable-altrcname=NAME’
Packit 1ac44c
     Use the file with the given NAME (in the user’s home directory) as
Packit 1ac44c
     nano’s settings file, instead of the default ‘.nanorc’.
Packit 1ac44c
Packit 1ac44c
‘--with-slang’
Packit 1ac44c
     Compile ‘nano’ against Slang instead of against ncurses or other
Packit 1ac44c
     curses libraries.
Packit 1ac44c
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
Tag Table:
Packit 1ac44c
Node: Top199
Packit 1ac44c
Node: Introduction556
Packit 1ac44c
Node: Invoking1356
Packit 1ac44c
Node: Command-line Options2402
Packit 1ac44c
Ref: --speller9568
Packit 1ac44c
Ref: Expert Mode10789
Packit 1ac44c
Node: Editor Basics11906
Packit 1ac44c
Node: Entering Text12190
Packit 1ac44c
Node: Commands13179
Packit 1ac44c
Node: The Cutbuffer13976
Packit 1ac44c
Node: The Mark14697
Packit 1ac44c
Node: Screen Layout15631
Packit 1ac44c
Node: Search and Replace16810
Packit 1ac44c
Node: Using the Mouse17545
Packit 1ac44c
Node: Limitations18162
Packit 1ac44c
Node: Built-in Help18718
Packit 1ac44c
Node: Feature Toggles19142
Packit 1ac44c
Node: Nanorc Files21474
Packit 1ac44c
Node: Settings23071
Packit 1ac44c
Ref: set functioncolor26032
Packit 1ac44c
Ref: Whitespace32324
Packit 1ac44c
Node: Syntax Highlighting32880
Packit 1ac44c
Node: Rebinding Keys37897
Packit 1ac44c
Node: The File Browser49797
Packit 1ac44c
Node: Pico Compatibility50690
Packit 1ac44c
Node: Building and Configure Options54226
Packit 1ac44c
?
Packit 1ac44c
End Tag Table
Packit 1ac44c
Packit 1ac44c
?
Packit 1ac44c
Local Variables:
Packit 1ac44c
coding: utf-8
Packit 1ac44c
End: