Scroll to navigation

NANORC(5) File Formats Manual NANORC(5)

NAME

nanorc - GNU nano's rcfile

DESCRIPTION

This manual page briefly documents GNU nano's rcfile.

nano is a small, free and friendly editor which aims to replace Pico, the default editor included in the non-free Pine package. Rather than just copying Pico's look and feel, nano also implements some missing (or disabled by default) features in Pico, such as "search and replace" and "go to line and column number".

The nanorc file contains the default settings for nano. It should not be in DOS or Mac format. During startup, nano will first read its system-wide settings from SYSCONFDIR/nanorc, and then user-specific settings from ~/.nanorc.

OPTIONS

The configuration file accepts a series of set and unset commands, which can be used to configure nano on startup without using the command line options. Additionally, the syntax, color, and icolor keywords are used to define syntax highlighting rules for different text patterns. nano will read one command per line.

Options in nanorc files take precedence over nano's defaults, and command line options override nanorc settings. Also, options are unset by default, except for those that take arguments.

Quotes inside string parameters don't have to be escaped with backslashes. The last double quote in the string will be treated as its end. For example, for the brackets option, ""')>]}" will match ", ', ), >, ], and }.

The supported commands and arguments are:

Use auto-indentation.
Create backup files in filename~.
Set the directory where nano puts unique backup files if file backups are enabled.
Do backwards searches by default.
Use bold text instead of reverse video text.
Set the characters treated as closing brackets when justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. The default value is ""')>]}".
Do case sensitive searches by default.
Constantly display the cursor position in the status bar.
Use cut to end of line by default.
Wrap lines at column number n. If n is 0 or less, the maximum line length will be the screen width less n columns. The default value is -8.
Enable ~/.nano_history for saving and reading search/replace strings.
Set the opening and closing brackets that can be found by bracket searches. They cannot contain blank characters. The former set must come before the latter set, and both must be in the same order. The default value is "(<[{)>]}".
Use the blank line below the titlebar as extra editing space.
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 System, and on the console when gpm is running.
Allow inserting files into their own buffers.
Don't convert files from DOS/Mac format.
Don't follow symlinks when writing files.
Don't display the help lists at the bottom of the screen.
Don't add newlines to the ends of files.
Don't wrap text at all.
nano will only read and write files inside directory and its subdirectories. Also, the current directory is changed to here, so files are inserted from this diractory. By default, the operating directory feature is turned off.
Preserve the XON and XOFF keys (^Q and ^S).
Set the characters treated as closing punctuation when justifying paragraphs. They cannot contain blank characters. Only closing punctuation, optionally followed by closing brackets, can end sentences. The default value is "!.?".
Do quick statusbar blanking. Statusbar messages will disappear after 1 keystroke instead of 25.
The email-quote string, used to justify email-quoted paragraphs. This is an extended regular expression if your system supports them, otherwise a literal string. The default value is "^([ \t]*[#:>\|}])+" if you have extended regular expression support, or "" otherwise. Note that '\t' stands for a literal Tab character.
Interpret the Delete key differently so that both Backspace and Delete work properly. You should only need to use this option if Backspace acts like Delete on your system.
Interpret the numeric keypad keys so that they all work properly. You should only need to use this option if they don't, as mouse support won't work properly with this option enabled.
Do extended regular expression searches by default.
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.
Use smooth scrolling by default.
Use spelling checker spellprog instead of the built-in one, which calls spell.
Allow nano to be suspended.
Use a tab size of n columns. The value of n must be greater than 0. The default value is 8.
Convert typed tabs to spaces.
Save automatically on exit, don't prompt.
Disallow file modification.
Set the two characters used to display the first characters of tabs and spaces. They must be single-column characters.
Detect word boundaries more accurately by treating punctuation characters as parts of words.
Defines a syntax named str which can be activated via the -Y/--syntax command line option, or will be automatically activated if the current filename matches the extended regular expression fileregex. All following color and icolor statements will apply to syntax until a new syntax is defined.

The none syntax is reserved; specifying it on the command line is the same as not having a syntax at all. The default syntax is special: it takes no fileregex, and applies to files that don't match any other syntax's fileregex.

For the currently defined syntax, display all expressions matching the extended regular expression regex with foreground color fgcolor and background color bgcolor, at least one of which must be specified. Legal colors for foreground and background color are: white, black, red, blue, green, yellow, magenta, and cyan. You may use the prefix "bright" to force a stronger color highlight for the foreground. If your terminal supports transparency, not specifying a bgcolor tells nano to attempt to use a transparent background.
Same as above, except that the expression matching is case insensitive.
Display expressions which start with the extended regular expression sr and end with the extended regular expression er with foreground color fgcolor and background color bgcolor, at least one of which must be specified. This allows syntax highlighting to span multiple lines. Note that all subsequent instances of sr after an initial sr is found will be highlighted until the first instance of er.
Same as above, except that the expression matching is case insensitive.
Read in self-contained color syntaxes from syntaxfile. Note that syntaxfile can only contain syntax, color, and icolor commands.

FILES

System-wide configuration file
~/.nanorc
Per-user configuration file

SEE ALSO

nano(1)

/usr/share/doc/nano/examples/nanorc.sample (or equivalent on your system)

AUTHOR

Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS and THANKS for details). This manual page was originally written by Jordi Mallach <jordi@gnu.org>, for the Debian system (but may be used by others).

version 2.0.0 August 23, 2007