1NANORC(5) File Formats Manual NANORC(5)
2
3
4
6 nanorc - GNU nano's rcfile
7
9 This manual page briefly documents GNU nano's rcfile.
10
11 nano is a small, free and friendly editor which aims to replace Pico,
12 the default editor included in the non-free Pine package. Rather than
13 just copying Pico's look and feel, nano also implements some missing
14 (or disabled by default) features in Pico, such as "search and replace"
15 and "go to line and column number".
16
17 The nanorc file contains the default settings for nano. It should not
18 be in DOS or Mac format. During startup, nano will first read its sys‐
19 tem-wide settings from SYSCONFDIR/nanorc, and then user-specific set‐
20 tings from ~/.nanorc.
21
22
24 The configuration file accepts a series of set and unset commands,
25 which can be used to configure nano on startup without using the com‐
26 mand line options. Additionally, the syntax, color, and icolor key‐
27 words are used to define syntax highlighting rules for different text
28 patterns. nano will read one command per line.
29
30 Options in nanorc files take precedence over nano's defaults, and com‐
31 mand line options override nanorc settings. Also, options are unset by
32 default, except for those that take arguments.
33
34 Quotes inside string parameters don't have to be escaped with back‐
35 slashes. The last double quote in the string will be treated as its
36 end. For example, for the brackets option, ""')>]}" will match ", ',
37 ), >, ], and }.
38
39 The supported commands and arguments are:
40
41
42 set/unset autoindent
43 Use auto-indentation.
44
45 set/unset backup
46 Create backup files in filename~.
47
48 set backupdir directory
49 Set the directory where nano puts unique backup files if file back‐
50 ups are enabled.
51
52 set/unset backwards
53 Do backwards searches by default.
54
55 set/unset boldtext
56 Use bold text instead of reverse video text.
57
58 set brackets string
59 Set the characters treated as closing brackets when justifying para‐
60 graphs. They cannot contain blank characters. Only closing punctu‐
61 ation, optionally followed by closing brackets, can end sentences.
62 The default value is ""')>]}".
63
64 set/unset casesensitive
65 Do case sensitive searches by default.
66
67 set/unset const
68 Constantly display the cursor position in the status bar.
69
70 set/unset cut
71 Use cut to end of line by default.
72
73 set fill n
74 Wrap lines at column number n. If n is 0 or less, the maximum line
75 length will be the screen width less n columns. The default value
76 is -8.
77
78 set/unset historylog
79 Enable ~/.nano_history for saving and reading search/replace
80 strings.
81
82 set matchbrackets string
83 Set the opening and closing brackets that can be found by bracket
84 searches. They cannot contain blank characters. The former set
85 must come before the latter set, and both must be in the same order.
86 The default value is "(<[{)>]}".
87
88 set/unset morespace
89 Use the blank line below the titlebar as extra editing space.
90
91 set/unset mouse
92 Enable mouse support, if available for your system. When enabled,
93 mouse clicks can be used to place the cursor, set the mark (with a
94 double click), and execute shortcuts. The mouse will work in the X
95 Window System, and on the console when gpm is running.
96
97 set/unset multibuffer
98 Allow inserting files into their own buffers.
99
100 set/unset noconvert
101 Don't convert files from DOS/Mac format.
102
103 set/unset nofollow
104 Don't follow symlinks when writing files.
105
106 set/unset nohelp
107 Don't display the help lists at the bottom of the screen.
108
109 set/unset nonewlines
110 Don't add newlines to the ends of files.
111
112 set/unset nowrap
113 Don't wrap text at all.
114
115 set operatingdir directory
116 nano will only read and write files inside directory and its subdi‐
117 rectories. Also, the current directory is changed to here, so files
118 are inserted from this diractory. By default, the operating direc‐
119 tory feature is turned off.
120
121 set/unset preserve
122 Preserve the XON and XOFF keys (^Q and ^S).
123
124 set punct string
125 Set the characters treated as closing punctuation when justifying
126 paragraphs. They cannot contain blank characters. Only closing
127 punctuation, optionally followed by closing brackets, can end sen‐
128 tences. The default value is "!.?".
129
130 set/unset quickblank
131 Do quick statusbar blanking. Statusbar messages will disappear
132 after 1 keystroke instead of 25.
133
134 set quotestr string
135 The email-quote string, used to justify email-quoted paragraphs.
136 This is an extended regular expression if your system supports them,
137 otherwise a literal string. The default value is
138 "^([ \t]*[#:>\|}])+" if you have extended regular expression sup‐
139 port, or "> " otherwise. Note that '\t' stands for a literal Tab
140 character.
141
142 set/unset rebinddelete
143 Interpret the Delete key differently so that both Backspace and
144 Delete work properly. You should only need to use this option if
145 Backspace acts like Delete on your system.
146
147 set/unset rebindkeypad
148 Interpret the numeric keypad keys so that they all work properly.
149 You should only need to use this option if they don't, as mouse sup‐
150 port won't work properly with this option enabled.
151
152 set/unset regexp
153 Do extended regular expression searches by default.
154
155 set/unset smarthome
156 Make the Home key smarter. When Home is pressed anywhere but at the
157 very beginning of non-whitespace characters on a line, the cursor
158 will jump to that beginning (either forwards or backwards). If the
159 cursor is already at that position, it will jump to the true begin‐
160 ning of the line.
161
162 set/unset smooth
163 Use smooth scrolling by default.
164
165 set speller spellprog
166 Use spelling checker spellprog instead of the built-in one, which
167 calls spell.
168
169 set/unset suspend
170 Allow nano to be suspended.
171
172 set tabsize n
173 Use a tab size of n columns. The value of n must be greater than 0.
174 The default value is 8.
175
176 set/unset tabstospaces
177 Convert typed tabs to spaces.
178
179 set/unset tempfile
180 Save automatically on exit, don't prompt.
181
182 set/unset view
183 Disallow file modification.
184
185 set whitespace string
186 Set the two characters used to display the first characters of tabs
187 and spaces. They must be single-column characters.
188
189 set/unset wordbounds
190 Detect word boundaries more accurately by treating punctuation char‐
191 acters as parts of words.
192
193 syntax str ["fileregex" ... ]
194 Defines a syntax named str which can be activated via the -Y/--syn‐
195 tax command line option, or will be automatically activated if the
196 current filename matches the extended regular expression fileregex.
197 All following color and icolor statements will apply to syntax until
198 a new syntax is defined.
199
200 The none syntax is reserved; specifying it on the command line is
201 the same as not having a syntax at all. The default syntax is spe‐
202 cial: it takes no fileregex, and applies to files that don't match
203 any other syntax's fileregex.
204
205 color fgcolor,bgcolor regex ...
206 For the currently defined syntax, display all expressions matching
207 the extended regular expression regex with foreground color fgcolor
208 and background color bgcolor, at least one of which must be speci‐
209 fied. Legal colors for foreground and background color are: white,
210 black, red, blue, green, yellow, magenta, and cyan. You may use the
211 prefix "bright" to force a stronger color highlight for the fore‐
212 ground. If your terminal supports transparency, not specifying a
213 bgcolor tells nano to attempt to use a transparent background.
214
215 icolor fgcolor,bgcolor regex ...
216 Same as above, except that the expression matching is case insensi‐
217 tive.
218
219 color fgcolor,bgcolor start="sr" end="er"
220 Display expressions which start with the extended regular expression
221 sr and end with the extended regular expression er with foreground
222 color fgcolor and background color bgcolor, at least one of which
223 must be specified. This allows syntax highlighting to span multiple
224 lines. Note that all subsequent instances of sr after an initial sr
225 is found will be highlighted until the first instance of er.
226
227 icolor fgcolor,bgcolor start="sr" end="er"
228 Same as above, except that the expression matching is case insensi‐
229 tive.
230
231 include syntaxfile
232 Read in self-contained color syntaxes from syntaxfile. Note that
233 syntaxfile can only contain syntax, color, and icolor commands.
234
236 SYSCONFDIR/nanorc
237 System-wide configuration file
238
239 ~/.nanorc
240 Per-user configuration file
241
243 nano(1)
244 /usr/share/doc/nano/examples/nanorc.sample (or equivalent on your sys‐
245 tem)
247 Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS and THANKS for
248 details). This manual page was originally written by Jordi Mallach
249 <jordi@gnu.org>, for the Debian system (but may be used by others).
250
251
252
253October 28, 2006 version 2.0.0 NANORC(5)