1 .\" Hey, EMACS: -*- nroff -*-
2 .\" Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
3 .\" Free Software Foundation, Inc.
5 .\" This document is dual-licensed. You may distribute and/or modify it
6 .\" under the terms of either of the following licenses:
8 .\" * The GNU General Public License, as published by the Free Software
9 .\" Foundation, version 3 or (at your option) any later version. You
10 .\" should have received a copy of the GNU General Public License
11 .\" along with this program. If not, see
12 .\" <http://www.gnu.org/licenses/>.
14 .\" * The GNU Free Documentation License, as published by the Free
15 .\" Software Foundation, version 1.2 or (at your option) any later
16 .\" version, with no Invariant Sections, no Front-Cover Texts, and no
17 .\" Back-Cover Texts. You should have received a copy of the GNU Free
18 .\" Documentation License along with this program. If not, see
19 .\" <http://www.gnu.org/licenses/>.
21 .\" $Id: nanorc.5 4533 2011-02-24 02:14:30Z astyanax $
22 .TH NANORC 5 "version 2.0.0" "August 23, 2007"
23 .\" Please adjust this date whenever revising the manpage.
26 nanorc \- GNU nano's rcfile
28 This manual page briefly documents GNU \fBnano\fP's rcfile.
30 \fBnano\fP is a small, free and friendly editor which aims to replace
31 Pico, the default editor included in the non-free Pine package. Rather
32 than just copying Pico's look and feel, \fBnano\fP also implements some
33 missing (or disabled by default) features in Pico, such as "search and
34 replace" and "go to line and column number".
36 The \fInanorc\fP file contains the default settings for \fBnano\fP. It
37 should not be in DOS or Mac format. During startup, \fBnano\fP will
38 first read its system-wide settings from \fISYSCONFDIR/nanorc\fP, and
39 then user-specific settings from \fI~/.nanorc\fP.
42 The configuration file accepts a series of \fBset\fP and \fBunset\fP
43 commands, which can be used to configure nano on startup without using
44 the command line options. Additionally, the \fBsyntax\fP, \fBcolor\fP,
45 and \fBicolor\fP keywords are used to define syntax highlighting rules
46 for different text patterns. \fBnano\fP will read one command per line.
48 Options in \fInanorc\fP files take precedence over nano's defaults, and
49 command line options override \fInanorc\fP settings. Also, options are
50 unset by default, except for those that take arguments.
52 Quotes inside string parameters don't have to be escaped with
53 backslashes. The last double quote in the string will be treated as its
54 end. For example, for the \fBbrackets\fP option, "\fI"')>]}\fP" will
55 match \fI"\fP, \fI'\fP, \fI)\fP, \fI>\fP, \fI]\fP, and \fI}\fP.
57 The supported commands and arguments are:
60 .B set/unset allow_insecure_backup
61 When backing up files, allow the backup to succeed even if its permissions
62 can't be (re)set due to special OS considerations. You should
63 NOT enable this option unless you are sure you need it.
65 .B set/unset autoindent
69 Create backup files in \fIfilename~\fP.
71 .B set backupdir "\fIdirectory\fP"
72 Set the directory where \fBnano\fP puts unique backup files if file
75 .B set/unset backwards
76 Do backwards searches by default.
79 Use bold text instead of reverse video text.
81 .B set brackets "\fIstring\fP"
82 Set the characters treated as closing brackets when justifying
83 paragraphs. They cannot contain blank characters. Only closing
84 punctuation, optionally followed by closing brackets, can end sentences.
85 The default value is "\fI"')>]}\fP".
87 .B set/unset casesensitive
88 Do case sensitive searches by default.
91 Constantly display the cursor position in the status bar.
94 Use cut to end of line by default.
97 Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the
98 maximum line length will be the screen width less \fIn\fP columns. The
101 .B set/unset historylog
102 Enable \fI~/.nano_history\fP for saving and reading search/replace
105 .B set matchbrackets "\fIstring\fP"
106 Set the opening and closing brackets that can be found by bracket
107 searches. They cannot contain blank characters. The former set must
108 come before the latter set, and both must be in the same order. The
109 default value is "\fI(<[{)>]}\fP".
111 .B set/unset morespace
112 Use the blank line below the titlebar as extra editing space.
115 Enable mouse support, if available for your system. When enabled, mouse
116 clicks can be used to place the cursor, set the mark (with a double
117 click), and execute shortcuts. The mouse will work in the X Window
118 System, and on the console when gpm is running.
120 .B set/unset multibuffer
121 Allow inserting files into their own buffers.
123 .B set/unset noconvert
124 Don't convert files from DOS/Mac format.
126 .B set/unset nofollow
127 Don't follow symlinks when writing files.
130 Don't display the help lists at the bottom of the screen.
132 .B set/unset nonewlines
133 Don't add newlines to the ends of files.
136 Don't wrap text at all.
138 .B set operatingdir "\fIdirectory\fP"
139 \fBnano\fP will only read and write files inside \fIdirectory\fP and its
140 subdirectories. Also, the current directory is changed to here, so
141 files are inserted from this directory. By default, the operating
142 directory feature is turned off.
144 .B set/unset preserve
145 Preserve the XON and XOFF keys (^Q and ^S).
147 .B set punct "\fIstring\fP"
148 Set the characters treated as closing punctuation when justifying
149 paragraphs. They cannot contain blank characters. Only closing
150 punctuation, optionally followed by closing brackets, can end sentences.
151 The default value is "\fI!.?\fP".
154 \fBnano\fP will not report errors in the \fInanorc\fP file and ask them
155 to be acknowledged by pressing enter at startup. If this is used it
156 should be placed at the top of the file to be fully effective.
158 .B set/unset quickblank
159 Do quick statusbar blanking. Statusbar messages will disappear after 1
160 keystroke instead of 25.
162 .B set quotestr "\fIstring\fP"
163 The email-quote string, used to justify email-quoted paragraphs. This
164 is an extended regular expression if your system supports them,
165 otherwise a literal string. The default value is
166 "\fI^([\ \\t]*[#:>\\|}])+\fP" if you have extended regular expression
167 support, or "\fI>\ \fP" otherwise. Note that '\\t' stands for a literal
170 .B set/unset rebinddelete
171 Interpret the Delete key differently so that both Backspace and Delete
172 work properly. You should only need to use this option if Backspace
173 acts like Delete on your system.
175 .B set/unset rebindkeypad
176 Interpret the numeric keypad keys so that they all work properly. You
177 should only need to use this option if they don't, as mouse support
178 won't work properly with this option enabled.
181 Do extended regular expression searches by default.
184 Save the cursor position of files between editing sessions.
186 .B set/unset smarthome
187 Make the Home key smarter. When Home is pressed anywhere but at the
188 very beginning of non-whitespace characters on a line, the cursor will
189 jump to that beginning (either forwards or backwards). If the cursor is
190 already at that position, it will jump to the true beginning of the
194 Use smooth scrolling by default.
196 .B set/unset softwrap
197 Enable soft line wrapping for easier viewing of very long lones.
199 .B set speller "\fIspellprog\fP"
200 Use spelling checker \fIspellprog\fP instead of the built-in one, which
204 Allow \fBnano\fP to be suspended.
206 .B set tabsize \fIn\fP
207 Use a tab size of \fIn\fP columns. The value of \fIn\fP must be greater
208 than 0. The default value is 8.
210 .B set/unset tabstospaces
211 Convert typed tabs to spaces.
213 .B set/unset tempfile
214 Save automatically on exit, don't prompt.
217 Enable experimental generic-purpose undo code.
220 Disallow file modification.
222 .B set/unset softwrap
223 Enable soft line wrapping for easier viewing of very long lones.
225 .B set whitespace "\fIstring\fP"
226 Set the two characters used to display the first characters of tabs and
227 spaces. They must be single-column characters.
229 .B set/unset wordbounds
230 Detect word boundaries more accurately by treating punctuation
231 characters as parts of words.
233 .B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
234 Defines a syntax named \fIstr\fP which can be activated via the
235 \-Y/\-\-syntax command line option, or will be automatically activated if
236 the current filename matches the extended regular expression
237 \fIfileregex\fP. All following \fBcolor\fP and \fBicolor\fP statements
238 will apply to \fIsyntax\fP until a new syntax is defined.
240 The \fInone\fP syntax is reserved; specifying it on the command line is
241 the same as not having a syntax at all. The \fIdefault\fP syntax is
242 special: it takes no \fIfileregex\fP, and applies to files that don't
243 match any other syntax's \fIfileregex\fP.
245 .B magic ["\fIregex\fP" ... ]
246 For the currently defined syntax, add one or more regexes which
247 will be compared against the \fBmagic\fP database when attempting
248 to determine which highlighting rules to use for a given file. This
249 functionality only works when \fBlibmagic\fP is installed on the
250 system and will be silently ignored otherwise.
252 .B color \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
253 For the currently defined syntax, display all expressions matching
254 the extended regular expression \fIregex\fP with foreground color
255 \fIfgcolor\fP and background color \fIbgcolor\fP, at least one of which
256 must be specified. Legal colors for foreground and background color
257 are: white, black, red, blue, green, yellow, magenta, and cyan. You may
258 use the prefix "bright" to force a stronger color highlight for the
259 foreground. If your terminal supports transparency, not specifying a
260 \fIbgcolor\fP tells \fBnano\fP to attempt to use a transparent
263 .B icolor \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
264 Same as above, except that the expression matching is case insensitive.
266 .B color \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
267 Display expressions which start with the extended regular expression
268 \fIsr\fP and end with the extended regular expression \fIer\fP with
269 foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
270 at least one of which must be specified. This allows syntax
271 highlighting to span multiple lines. Note that all subsequent instances
272 of \fIsr\fP after an initial \fIsr\fP is found will be highlighted until
273 the first instance of \fIer\fP.
275 .B icolor \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
276 Same as above, except that the expression matching is case insensitive.
278 .B include "\fIsyntaxfile\fP"
279 Read in self-contained color syntaxes from \fIsyntaxfile\fP. Note that
280 \fIsyntaxfile\fP can only contain \fBsyntax\fP, \fBcolor\fP, and
281 \fBicolor\fP commands.
283 Key bindings may be reassigned via the following commands:
285 .B bind \fIkey\fP \fIfunction\fP \fImenu\fP
286 Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
287 context of menu \fImenu\fP. The format of \fIkey\fP should be one of:
290 followed by an alpha character or the word "Space".
294 followed by a printable character or the word "Space".
298 followed by a numeric value from 1 to 16.
301 Valid function names to be bound include:
304 Invoke the help menu.
307 Cancel the current command.
310 Exit from the program.
313 Write the current buffer to disk.
316 Justify the current text.
319 Insert a file into the current buffer (or into a new buffer when multibuffer
323 Search for text in the current buffer.
326 Repeat the last search command.
329 Move up in the editor or browser.
332 Move down in the editor or browser.
335 Move left in the editor or browser.
338 Move right in the editor or browser.
341 Cut the current line of text and store it.
344 Copy the currently stored text into the current buffer position.
347 Show the current line, column, word positions in the file.
350 Move to the first line of the file.
353 Move to the last line of the file.
356 Move to a specific line (and column if specified).
359 Interactively replace text within the current buffer.
362 Begin selecting text for cutting or pasting at the current position.
365 Copy the currently marked text without deleting it.
368 Indent the currently marked text (shift to the right).
371 Un-indent the currently marked text (shift to the left).
374 Move the cursor to the beginning of the next word.
377 Move the cursor to the beginning of the previous word.
380 Move the cursor to the beginning of the current line.
383 Move the cursor to the end of the current line.
386 Move the cursor to the beginning of the current paragraph.
389 Move the cursor to the end of the current paragraph.
392 Move the cursor to the matching bracket (brace, parenthesis, etc.) of the one
396 Scroll up one line of text from the current position.
399 Scroll down one line of text from the current position.
402 Switch to editing/viewing the previous buffer when using multibuffer mode.
405 Switch to editing/viewing the next buffer when using multibuffer mode.
408 Insert the next character verbatim into the file.
411 Insert a tab at the current cursor location.
414 Insert a new line below the current one.
417 Delete the character under the cursor.
420 Justify the entire current file.
423 Count the number of words in the current buffer.
429 Undo the text action peformed (add text, delete text, etc).
432 Redo the last undone action (i.e., undo an undo).
435 Suspend the editor (if the suspend function is enabled, see the
436 "suspendenable" entry below).
439 Toggle case sensitivity in searching (search/replace menus only).
442 Toggle whether searching/replacing is based on literal strings or regular expressions.
445 Show the previous history entry in the prompt menus (e.g. search).
448 Show the next history entry in the prompt menus (e.g. search).
451 Switch back to searching instead of replacing.
454 Search for files matching a string in the file browser (reading or writing files).
457 When writing a file, switch to writing a DOS format (CR/LF).
460 When writing a file, switch to writing a Mac format.
463 When writing a file, append to the end instead of overwriting.
466 When writing a file, 'prepend' (write at the beginning) instead of overwriting.
469 When writing a file, create a backup of the current file.
472 Move to the first file when using the file browser (reading or writing files).
475 Move to the last file when using the file browser (reading or writing files).
478 Toggle showing/hiding the two-line list of key bindings at the bottom of the screen.
481 Constantly display the current line, column, word positions.
484 Toggle showing/hiding the blank line which 'separates' the 'title' from the file text.
487 Toggle smooth scrolling when moving via the arrow keys.
490 Toggle whether whitespace is shown.
493 Toggle whether the smart home key function is enabled.
496 Toggle whether new lines will contain the same amount of whitespace as the line above.
499 Toggle whether cutting text will cut the whole line or just from the current cursor
500 position to the end of the line.
503 Toggle whether long lines will be wrapped to the next line.
506 Toggle whether the suspend sequence (normally ^Z) will suspend the editor window.
509 Valid menu sections are:
512 The main editor window where text is entered.
515 The search menu (AKA whereis).
518 The 'search to replace' menu.
521 The 'replace with' menu, which comes up after 'search to replace'.
524 The 'goto line (and column)' menu.
527 The 'write file' menu.
530 The 'insert file' menu.
533 The menu for inserting output from an external comman, reached from the insert menu.
539 The interactive spell checker Yes/no menu.
542 The file browser for inserting or writing a file.
545 The 'search for a file' menu in the file browser.
548 The 'go to directory' menu.
551 A special name meaning: apply to all menus where this function exists.
554 .B unbind \fIkey\fP \fImenu\fP
555 Unbind the key \fIkey\fP from the menu named \fImenu\fP or from all
556 menus by using \fIall\fP. Same key syntax as for binding.
557 Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
558 context of menu \fImenu\fP. The format of \fIkey\fP should be one of:
562 System-wide configuration file
565 Per-user configuration file
571 \fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
574 Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
575 \fITHANKS\fP for details). This manual page was originally written by
576 Jordi Mallach <jordi@gnu.org>, for the Debian system (but may be used by