1NANORC(5) File Formats Manual NANORC(5)
2
3
4
6 nanorc - GNU nano's configuration file
7
8
10 The nanorc files contain the default settings for nano, a small and
11 friendly editor. During startup, if --rcfile is not given, nano will
12 read two files: first the system-wide settings, from /etc/nanorc (the
13 exact path might be different on your system), and then the user-spe‐
14 cific settings, either from ~/.nanorc or from $XDG_CON‐
15 FIG_HOME/nano/nanorc or from ~/.config/nano/nanorc, whichever is en‐
16 countered first. If --rcfile is given, nano will read just the speci‐
17 fied settings file.
18
19
21 The configuration file accepts a series of set and unset commands,
22 which can be used to configure nano on startup without using command-
23 line options. Additionally, there are some commands to define syntax
24 highlighting and to rebind keys -- see the two separate sections on
25 those. nano reads one command per line. All commands and keywords
26 should be written in lowercase.
27
28 Options in nanorc files take precedence over nano's defaults, and com‐
29 mand-line options override nanorc settings. Also, options that do not
30 take an argument are unset by default. So using the unset command is
31 only needed when wanting to override a setting of the system's nanorc
32 file in your own nanorc. Options that take an argument cannot be un‐
33 set.
34
35 Quotes inside the characters parameters below should not be escaped.
36 The last double quote on the line will be seen as the closing quote.
37
38 The supported commands and arguments are:
39
40 set afterends
41 Make Ctrl+Right and Ctrl+Delete stop at word ends instead of begin‐
42 nings.
43
44 set allow_insecure_backup
45 When backing up files, allow the backup to succeed even if its per‐
46 missions can't be (re)set due to special OS considerations. You
47 should NOT enable this option unless you are sure you need it.
48
49 set atblanks
50 When soft line wrapping is enabled, make it wrap lines at blank
51 characters (tabs and spaces) instead of always at the edge of the
52 screen.
53
54 set autoindent
55 Automatically indent a newly created line to the same number of tabs
56 and/or spaces as the previous line (or as the next line if the pre‐
57 vious line is the beginning of a paragraph).
58
59 set backup
60 When saving a file, create a backup file by adding a tilde (~) to
61 the file's name.
62
63 set backupdir directory
64 Make and keep not just one backup file, but make and keep a uniquely
65 numbered one every time a file is saved -- when backups are enabled
66 with set backup or --backup or -B. The uniquely numbered files are
67 stored in the specified directory.
68
69 set boldtext
70 Use bold instead of reverse video for the title bar, status bar, key
71 combos, function tags, line numbers, and selected text. This can be
72 overridden by setting the options titlecolor, statuscolor, keycolor,
73 functioncolor, numbercolor, and selectedcolor.
74
75 set bookstyle
76 When justifying, treat any line that starts with whitespace as the
77 beginning of a paragraph (unless auto-indenting is on).
78
79 set brackets "characters"
80 Set the characters treated as closing brackets when justifying para‐
81 graphs. This may not include blank characters. Only closing punc‐
82 tuation (see set punct), optionally followed by the specified clos‐
83 ing brackets, can end sentences. The default value is ""')>]}".
84
85 set breaklonglines
86 Automatically hard-wrap the current line when it becomes overlong.
87
88 set casesensitive
89 Do case-sensitive searches by default.
90
91 set constantshow
92 Constantly display the cursor position in the status bar. This
93 overrides the option quickblank.
94
95 set cutfromcursor
96 Use cut-from-cursor-to-end-of-line by default, instead of cutting
97 the whole line.
98
99 set emptyline
100 Do not use the line below the title bar, leaving it entirely blank.
101
102 set errorcolor [bold,][italic,]fgcolor,bgcolor
103 Use this color combination for the status bar when an error message
104 is displayed. The default value is bold,white,red. See set title‐
105 color for valid color names.
106
107 set fill number
108 Set the target width for justifying and automatic hard-wrapping at
109 this number of columns. If the value is 0 or less, wrapping will
110 occur at the width of the screen minus number columns, allowing the
111 wrap point to vary along with the width of the screen if the screen
112 is resized. The default value is -8.
113
114 set functioncolor [bold,][italic,]fgcolor,bgcolor
115 Use this color combination for the concise function descriptions in
116 the two help lines at the bottom of the screen. See set titlecolor
117 for more details.
118
119 set guidestripe number
120 Draw a vertical stripe at the given column, to help judge the width
121 of the text. (The color of the stripe can be changed with set
122 stripecolor.)
123
124 set historylog
125 Save the last hundred search strings and replacement strings and ex‐
126 ecuted commands, so they can be easily reused in later sessions.
127
128 set indicator
129 Display a "scrollbar" on the righthand side of the edit window. It
130 shows the position of the viewport in the buffer and how much of the
131 buffer is covered by the viewport.
132
133 set jumpyscrolling
134 Scroll the buffer contents per half-screen instead of per line.
135
136 set keycolor [bold,][italic,]fgcolor,bgcolor
137 Use this color combination for the shortcut key combos in the two
138 help lines at the bottom of the screen. See set titlecolor for more
139 details.
140
141 set linenumbers
142 Display line numbers to the left of the text area. (Any line with
143 an anchor additionally gets a mark in the margin.)
144
145 set locking
146 Enable vim-style lock-files for when editing files.
147
148 set magic
149 When neither the file's name nor its first line give a clue, try us‐
150 ing libmagic to determine the applicable syntax. (Calling libmagic
151 can be relatively time consuming. It is therefore not done by de‐
152 fault.)
153
154 set matchbrackets "characters"
155 Specify the opening and closing brackets that can be found by
156 bracket searches. This may not include blank characters. The open‐
157 ing set must come before the closing set, and the two sets must be
158 in the same order. The default value is "(<[{)>]}".
159
160 set minibar
161 Suppress the title bar and instead show information about the cur‐
162 rent buffer at the bottom of the screen, in the space for the status
163 bar. In this "minibar" the filename is shown on the left, followed
164 by an asterisk if the buffer has been modified. On the right are
165 displayed the current line and column number, the code of the char‐
166 acter under the cursor (in Unicode format: U+xxxx), the same flags
167 as are shown by set stateflags, and a percentage that expresses how
168 far the cursor is into the file (linewise). When a file is loaded
169 or saved, and also when switching between buffers, the number of
170 lines in the buffer is displayed after the filename. This number is
171 cleared upon the next keystroke, or replaced with an [i/n] counter
172 when multiple buffers are open. The line plus column numbers and
173 the character code are displayed only when set constantshow is used,
174 and can be toggled on and off with M-C. The state flags are dis‐
175 played only when set stateflags is used.
176
177 set minicolor [bold,][italic,]fgcolor,bgcolor
178 Use this color combination for the minibar. (When this option is
179 not specified, the colors of the title bar are used.) See set ti‐
180 tlecolor for more details.
181
182 set mouse
183 Enable mouse support, if available for your system. When enabled,
184 mouse clicks can be used to place the cursor, set the mark (with a
185 double click), and execute shortcuts. The mouse will work in the X
186 Window System, and on the console when gpm is running. Text can
187 still be selected through dragging by holding down the Shift key.
188
189 set multibuffer
190 When reading in a file with ^R, insert it into a new buffer by de‐
191 fault.
192
193 set noconvert
194 Don't convert files from DOS/Mac format.
195
196 set nohelp
197 Don't display the two help lines at the bottom of the screen.
198
199 set nonewlines
200 Don't automatically add a newline when a text does not end with one.
201 (This can cause you to save non-POSIX text files.)
202
203 set nowrap
204 Deprecated option since it has become the default setting. When
205 needed, use unset breaklonglines instead.
206
207 set numbercolor [bold,][italic,]fgcolor,bgcolor
208 Use this color combination for line numbers. See set titlecolor for
209 more details.
210
211 set operatingdir directory
212 nano will only read and write files inside directory and its subdi‐
213 rectories. Also, the current directory is changed to here, so files
214 are inserted from this directory. By default, the operating direc‐
215 tory feature is turned off.
216
217 set positionlog
218 Save the cursor position of files between editing sessions. The
219 cursor position is remembered for the 200 most-recently edited
220 files.
221
222 set preserve
223 Preserve the XON and XOFF keys (^Q and ^S).
224
225 set promptcolor [bold,][italic,]fgcolor,bgcolor
226 Use this color combination for the prompt bar. (When this option is
227 not specified, the colors of the title bar are used.) See set ti‐
228 tlecolor for more details.
229
230 set punct "characters"
231 Set the characters treated as closing punctuation when justifying
232 paragraphs. This may not include blank characters. Only the spec‐
233 fified closing punctuation, optionally followed by closing brackets
234 (see brackets), can end sentences. The default value is "!.?".
235
236 set quickblank
237 Make status-bar messages disappear after 1 keystroke instead of af‐
238 ter 20. Note that option constantshow overrides this. When option
239 minibar or zero is in effect, quickblank makes a message disappear
240 after 0.8 seconds instead of after the default 1.5 seconds.
241
242 set quotestr "regex"
243 Set the regular expression for matching the quoting part of a line.
244 The default value is "^([ \t]*([!#%:;>|}]|//))+". (Note that \t
245 stands for an actual Tab character.) This makes it possible to re‐
246 justify blocks of quoted text when composing email, and to rewrap
247 blocks of line comments when writing source code.
248
249 set rawsequences
250 Interpret escape sequences directly, instead of asking ncurses to
251 translate them. (If you need this option to get some keys to work
252 properly, it means that the terminfo terminal description that is
253 used does not fully match the actual behavior of your terminal.
254 This can happen when you ssh into a BSD machine, for example.) Us‐
255 ing this option disables nano's mouse support.
256
257 set rebinddelete
258 Interpret the Delete and Backspace keys differently so that both
259 Backspace and Delete work properly. You should only use this option
260 when on your system either Backspace acts like Delete or Delete acts
261 like Backspace.
262
263 set regexp
264 Do regular-expression searches by default. Regular expressions in
265 nano are of the extended type (ERE).
266
267 set saveonexit
268 Save a changed buffer automatically on exit (^X); don't prompt.
269
270 set scrollercolor fgcolor,bgcolor
271 Use this color combination for the indicator alias "scrollbar". (On
272 terminal emulators that link to a libvte older than version 0.55,
273 using a background color here does not work correctly.) See set ti‐
274 tlecolor for more details.
275
276 set selectedcolor [bold,][italic,]fgcolor,bgcolor
277 Use this color combination for selected text. See set titlecolor
278 for more details.
279
280 set showcursor
281 Put the cursor on the highlighted item in the file browser, and show
282 the cursor in the help viewer, to aid braille users and people with
283 poor vision.
284
285 set smarthome
286 Make the Home key smarter. When Home is pressed anywhere but at the
287 very beginning of non-whitespace characters on a line, the cursor
288 will jump to that beginning (either forwards or backwards). If the
289 cursor is already at that position, it will jump to the true begin‐
290 ning of the line.
291
292 set softwrap
293 Display lines that exceed the screen's width over multiple screen
294 lines. (You can make this soft-wrapping occur at whitespace instead
295 of rudely at the screen's edge, by using also set atblanks.)
296
297 set speller "program [argument ...]"
298 Use the given program to do spell checking and correcting, instead
299 of using the built-in corrector that calls hunspell(1) or spell(1).
300
301 set spotlightcolor [bold,][italic,]fgcolor,bgcolor
302 Use this color combination for highlighting a search match. The de‐
303 fault value is black,lightyellow. See set titlecolor for valid
304 color names.
305
306 set stateflags
307 Use the top-right corner of the screen for showing some state flags:
308 I when auto-indenting, M when the mark is on, L when hard-wrapping
309 (breaking long lines), R when recording a macro, and S when soft-
310 wrapping. When the buffer is modified, a star (*) is shown after
311 the filename in the center of the title bar.
312
313 set statuscolor [bold,][italic,]fgcolor,bgcolor
314 Use this color combination for the status bar. See set titlecolor
315 for more details.
316
317 set stripecolor [bold,][italic,]fgcolor,bgcolor
318 Use this color combination for the vertical guiding stripe. See set
319 titlecolor for more details.
320
321 set tabsize number
322 Use a tab size of number columns. The value of number must be
323 greater than 0. The default value is 8.
324
325 set tabstospaces
326 Convert each typed tab to spaces -- to the number of spaces that a
327 tab at that position would take up.
328
329 set titlecolor [bold,][italic,]fgcolor,bgcolor
330 Use this color combination for the title bar. Valid names for the
331 foreground and background colors are: red, green, blue, magenta,
332 yellow, cyan, white, and black. Each of these eight names may be
333 prefixed with the word light to get a brighter version of that
334 color. The word grey or gray may be used as a synonym for light‐
335 black. On terminal emulators that can do at least 256 colors, other
336 valid (but unprefixable) color names are: pink, purple, mauve, la‐
337 goon, mint, lime, peach, orange, latte, rosy, beet, plum, sea, sky,
338 slate, teal, sage, brown, ocher, sand, tawny, brick, crimson, and
339 normal -- where normal means the default foreground or background
340 color. On such emulators, the color may also be specified as a
341 three-digit hexadecimal number prefixed with #, with the digits rep‐
342 resenting the amounts of red, green, and blue, respectively. This
343 tells nano to select from the available palette the color that ap‐
344 proximates the given values.
345
346 Either "fgcolor" or ",bgcolor" may be left out, and the pair may be
347 preceded by bold and/or italic (separated by commas) to get a bold
348 and/or slanting typeface, if your terminal can do those.
349
350 set trimblanks
351 Remove trailing whitespace from wrapped lines when automatic hard-
352 wrapping occurs or when text is justified.
353
354 set unix
355 Save a file by default in Unix format. This overrides nano's de‐
356 fault behavior of saving a file in the format that it had. (This
357 option has no effect when you also use set noconvert.)
358
359 set whitespace "characters"
360 Set the two characters used to indicate the presence of tabs and
361 spaces. They must be single-column characters. The default pair
362 for a UTF-8 locale is "»⋅", and for other locales ">.".
363
364 set wordbounds
365 Detect word boundaries differently by treating punctuation charac‐
366 ters as parts of words.
367
368 set wordchars "characters"
369 Specify which other characters (besides the normal alphanumeric
370 ones) should be considered as parts of words. When using this op‐
371 tion, you probably want to unset wordbounds.
372
373 set zap
374 Let an unmodified Backspace or Delete erase the marked region (in‐
375 stead of a single character, and without affecting the cutbuffer).
376
377 set zero
378 Hide all elements of the interface (title bar, status bar, and help
379 lines) and use all rows of the terminal for showing the contents of
380 the buffer. The status bar appears only when there is a significant
381 message, and disappears after 1.5 seconds or upon the next key‐
382 stroke. With M-Z the title bar plus status bar can be toggled.
383 With M-X the help lines.
384
385
387 Option set suspendable has been removed. Suspension is enabled by de‐
388 fault, reachable via ^T^Z. (If you want a plain ^Z to suspend nano,
389 add bind ^Z suspend main to your nanorc.)
390
391
393 Coloring the different syntactic elements of a file is done via regular
394 expressions (see the color command below). This is inherently imper‐
395 fect, because regular expressions are not powerful enough to fully
396 parse a file. Nevertheless, regular expressions can do a lot and are
397 easy to make, so they are a good fit for a small editor like nano.
398
399 All regular expressions in nano are POSIX extended regular expressions.
400 This means that ., ?, *, +, ^, $, and several other characters are spe‐
401 cial. The period . matches any single character, ? means the preceding
402 item is optional, * means the preceding item may be matched zero or
403 more times, + means the preceding item must be matched one or more
404 times, ^ matches the beginning of a line, and $ the end, \< matches the
405 start of a word, and \> the end, and \s matches a blank. It also means
406 that lookahead and lookbehind are not possible. A complete explanation
407 can be found in the manual page of GNU grep: man grep.
408
409 For each kind of file a separate syntax can be defined via the follow‐
410 ing commands:
411
412 syntax name ["fileregex" ...]
413 Start the definition of a syntax with this name. All subsequent
414 color and other such commands will be added to this syntax, un‐
415 til a new syntax command is encountered.
416
417 When nano is run, this syntax will be automatically activated if
418 the current filename matches the extended regular expression
419 fileregex. Or the syntax can be explicitly activated by using
420 the -Y or --syntax command-line option followed by the name.
421
422 The syntax default is special: it takes no fileregex, and ap‐
423 plies to files that don't match any syntax's regexes. The syn‐
424 tax none is reserved; specifying it on the command line is the
425 same as not having a syntax at all.
426
427 header "regex" ...
428 If from all defined syntaxes no fileregex matched, then compare
429 this regex (or regexes) against the first line of the current
430 file, to determine whether this syntax should be used for it.
431
432 magic "regex" ...
433 If no fileregex matched and no header regex matched either, then
434 compare this regex (or regexes) against the result of querying
435 the magic database about the current file, to determine whether
436 this syntax should be used for it. (This functionality only
437 works when libmagic is installed on the system and will be
438 silently ignored otherwise.)
439
440 formatter program [argument ...]
441 Run the given program on the full contents of the current buf‐
442 fer.
443
444 linter program [argument ...]
445 Use the given program to run a syntax check on the current buf‐
446 fer.
447
448 comment "string"
449 Use the given string for commenting and uncommenting lines. If
450 the string contains a vertical bar or pipe character (|), this
451 designates bracket-style comments; for example, "/*|*/" for CSS
452 files. The characters before the pipe are prepended to the line
453 and the characters after the pipe are appended at the end of the
454 line. If no pipe character is present, the full string is
455 prepended; for example, "#" for Python files. If empty double
456 quotes are specified, the comment/uncomment function is dis‐
457 abled; for example, "" for JSON. The default value is "#".
458
459 tabgives "string"
460 Make the <Tab> key produce the given string. Useful for lan‐
461 guages like Python that want to see only spaces for indentation.
462 This overrides the setting of the tabstospaces option.
463
464 color [bold,][italic,]fgcolor,bgcolor "regex" ...
465 Paint all pieces of text that match the extended regular expres‐
466 sion regex with the given foreground and background colors, at
467 least one of which must be specified. Valid color names are:
468 red, green, blue, magenta, yellow, cyan, white, and black. Each
469 of these eight names may be prefixed with the word light to get
470 a brighter version of that color. The word grey or gray may be
471 used as a synonym for lightblack. On terminal emulators that
472 can do at least 256 colors, other valid (but unprefixable) color
473 names are: pink, purple, mauve, lagoon, mint, lime, peach, or‐
474 ange, latte, rosy, beet, plum, sea, sky, slate, teal, sage,
475 brown, ocher, sand, tawny, brick, crimson, and normal -- where
476 normal means the default foreground or background color. On
477 such emulators, the color may also be specified as a three-digit
478 hexadecimal number prefixed with #, with the digits representing
479 the amounts of red, green, and blue, respectively. This tells
480 nano to select from the available palette the color that approx‐
481 imates the given values.
482
483 The color pair may be preceded by bold and/or italic (separated
484 by commas) to get a bold and/or slanting typeface, if your ter‐
485 minal can do those.
486
487 All coloring commands are applied in the order in which they are
488 specified, which means that later commands can recolor stuff
489 that was colored earlier.
490
491 icolor [bold,][italic,]fgcolor,bgcolor "regex" ...
492 Same as above, except that the matching is case insensitive.
493
494 color [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx"
495 Paint all pieces of text whose start matches extended regular
496 expression fromrx and whose end matches extended regular expres‐
497 sion torx with the given foreground and background colors, at
498 least one of which must be specified. This means that, after an
499 initial instance of fromrx, all text until the first instance of
500 torx will be colored. This allows syntax highlighting to span
501 multiple lines.
502
503 icolor [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx"
504 Same as above, except that the matching is case insensitive.
505
506 include "syntaxfile"
507 Read in self-contained color syntaxes from syntaxfile. Note
508 that syntaxfile may contain only the above commands, from syntax
509 to icolor.
510
511 extendsyntax name command argument ...
512 Extend the syntax previously defined as name with another com‐
513 mand. This allows adding a new color, icolor, header, magic,
514 formatter, linter, comment, or tabgives command to an already
515 defined syntax -- useful when you want to slightly improve a
516 syntax defined in one of the system-installed files (which nor‐
517 mally are not writable).
518
519
521 Key bindings can be changed via the following three commands:
522
523 bind key function menu
524 Rebinds the given key to the given function in the given menu
525 (or in all menus where the function exists when all is used).
526
527 bind key "string" menu
528 Makes the given key produce the given string in the given
529 menu (or in all menus where the key exists when all is used).
530 The string can consist of text or commands or a mix of them.
531 (To enter a command into the string, precede its keystroke
532 with M-V.)
533
534 unbind key menu
535 Unbinds the given key from the given menu (or from all menus
536 where the key exists when all is used).
537
538
539 The format of key should be one of:
540
541 ^X where X is a Latin letter, or one of several ASCII characters
542 (@, ], \, ^, _), or the word "Space". Example: ^C.
543
544 M-X where X is any ASCII character except [, or the word "Space".
545 Example: M-8.
546
547 Sh-M-X where X is a Latin letter. Example: Sh-M-U. By default,
548 each Meta+letter keystroke does the same as the corresponding
549 Shift+Meta+letter. But when any Shift+Meta bind is made,
550 that will no longer be the case, for all letters.
551
552 FN where N is a numeric value from 1 to 24. Example: F10. (Of‐
553 ten, F13 to F24 can be typed as F1 to F12 with Shift.)
554
555 Ins or Del.
556
557 Rebinding ^M (Enter) or ^I (Tab) is probably not a good idea. Rebind‐
558 ing ^[ (Esc) is not possible, because its keycode is the starter byte
559 of Meta keystrokes and escape sequences. Rebinding any of the dedi‐
560 cated cursor-moving keys (the arrows, Home, End, PageUp and PageDown)
561 is not possible. On some terminals it's not possible to rebind ^H (un‐
562 less --raw is used) because its keycode is identical to that of the
563 Backspace key.
564
565
566 Valid function names to be bound are:
567
568 help
569 Invokes the help viewer.
570
571 cancel
572 Cancels the current command.
573
574 exit
575 Exits from the program (or from the help viewer or file browser).
576
577 writeout
578 Writes the current buffer to disk, asking for a name.
579
580 savefile
581 Writes the current file to disk without prompting.
582
583 insert
584 Inserts a file into the current buffer (at the current cursor po‐
585 sition), or into a new buffer when option multibuffer is set.
586
587 whereis
588 Starts a forward search for text in the current buffer -- or for
589 filenames matching a string in the current list in the file
590 browser.
591
592 wherewas
593 Starts a backward search for text in the current buffer -- or for
594 filenames matching a string in the current list in the file
595 browser.
596
597 findprevious
598 Searches the next occurrence in the backward direction.
599
600 findnext
601 Searches the next occurrence in the forward direction.
602
603 replace
604 Interactively replaces text within the current buffer.
605
606 cut
607 Cuts and stores the current line (or the marked region).
608
609 copy
610 Copies the current line (or the marked region) without deleting
611 it.
612
613 paste
614 Pastes the currently stored text into the current buffer at the
615 current cursor position.
616
617 zap
618 Throws away the current line (or the marked region). (This func‐
619 tion is bound by default to <Meta+Delete>.)
620
621 chopwordleft
622 Deletes from the cursor position to the beginning of the preceding
623 word. (This function is bound by default to <Shift+Ctrl+Delete>.
624 If your terminal produces ^H for <Ctrl+Backspace>, you can make
625 <Ctrl+Backspace> delete the word to the left of the cursor by re‐
626 binding ^H to this function.)
627
628 chopwordright
629 Deletes from the cursor position to the beginning of the next
630 word. (This function is bound by default to <Ctrl+Delete>.)
631
632 cutrestoffile
633 Cuts all text from the cursor position till the end of the buffer.
634
635 mark
636 Sets the mark at the current position, to start selecting text.
637 Or, when it is set, unsets the mark.
638
639 location
640 Reports the current position of the cursor in the buffer: the
641 line, column, and character positions.
642
643 wordcount
644 Counts and reports on the status bar the number of lines, words,
645 and characters in the current buffer (or in the marked region).
646
647 execute
648 Prompts for a program to execute. The program's output will be
649 inserted into the current buffer (or into a new buffer when M-F is
650 toggled).
651
652 speller
653 Invokes a spell-checking program, either the default hunspell(1)
654 or GNU spell(1), or the one defined by --speller or set speller.
655
656 formatter
657 Invokes a full-buffer-processing program (if the active syntax de‐
658 fines one). (The current buffer is written out to a temporary
659 file, the program is run on it, and then the temporary file is
660 read back in, replacing the contents of the buffer.)
661
662 linter
663 Invokes a syntax-checking program (if the active syntax defines
664 one). If this program produces lines of the form "file‐
665 name:linenum:charnum: some message", then the cursor will be put
666 at the indicated position in the mentioned file while showing
667 "some message" on the status bar. You can move from message to
668 message with <PgUp> and <PgDn>, and leave linting mode with ^C or
669 <Enter>.
670
671 justify
672 Justifies the current paragraph (or the marked region). A para‐
673 graph is a group of contiguous lines that, apart from possibly the
674 first line, all have the same indentation. The beginning of a
675 paragraph is detected by either this lone line with a differing
676 indentation or by a preceding blank line.
677
678 fulljustify
679 Justifies the entire current buffer (or the marked region).
680
681 indent
682 Indents (shifts to the right) the current line or the marked
683 lines.
684
685 unindent
686 Unindents (shifts to the left) the current line or the marked
687 lines.
688
689 comment
690 Comments or uncomments the current line or the marked lines, using
691 the comment style specified in the active syntax.
692
693 complete
694 Completes (when possible) the fragment before the cursor to a full
695 word found elsewhere in the current buffer.
696
697 left
698 Goes left one position (in the editor or browser).
699
700 right
701 Goes right one position (in the editor or browser).
702
703 up
704 Goes one line up (in the editor or browser).
705
706 down
707 Goes one line down (in the editor or browser).
708
709 scrollup
710 Scrolls the viewport up one row (meaning that the text slides
711 down) while keeping the cursor in the same text position, if pos‐
712 sible. (This function is bound by default to <Alt+Up>. If
713 <Alt+Up> does nothing on your Linux console, see the FAQ:
714 ⟨https://nano-editor.org/dist/latest/faq.html#4.1⟩.)
715
716 scrolldown
717 Scrolls the viewport down one row (meaning that the text slides
718 up) while keeping the cursor in the same text position, if possi‐
719 ble. (This function is bound by default to <Alt+Down>.)
720
721 center
722 Scrolls the line with the cursor to the middle of the screen.
723
724 prevword
725 Moves the cursor to the beginning of the previous word.
726
727 nextword
728 Moves the cursor to the beginning of the next word.
729
730 home
731 Moves the cursor to the beginning of the current line.
732
733 end
734 Moves the cursor to the end of the current line.
735
736 beginpara
737 Moves the cursor to the beginning of the current paragraph.
738
739 endpara
740 Moves the cursor to the end of the current paragraph.
741
742 prevblock
743 Moves the cursor to the beginning of the current or preceding
744 block of text. (Blocks are separated by one or more blank lines.)
745
746 nextblock
747 Moves the cursor to the beginning of the next block of text.
748
749 pageup
750 Goes up one screenful.
751
752 pagedown
753 Goes down one screenful.
754
755 firstline
756 Goes to the first line of the file.
757
758 lastline
759 Goes to the last line of the file.
760
761 gotoline
762 Goes to a specific line (and column if specified). Negative num‐
763 bers count from the end of the file (and end of the line).
764
765 findbracket
766 Moves the cursor to the bracket (or brace or parenthesis, etc.)
767 that matches (pairs) with the one under the cursor. See set
768 matchbrackets.
769
770 anchor
771 Places an anchor at the current line, or removes it when already
772 present. (An anchor is visible when line numbers are activated.)
773
774 prevanchor
775 Goes to the first anchor before the current line.
776
777 nextanchor
778 Goes to the first anchor after the current line.
779
780 prevbuf
781 Switches to editing/viewing the previous buffer when multiple buf‐
782 fers are open.
783
784 nextbuf
785 Switches to editing/viewing the next buffer when multiple buffers
786 are open.
787
788 verbatim
789 Inserts the next keystroke verbatim into the file.
790
791 tab
792 Inserts a tab at the current cursor location.
793
794 enter
795 Inserts a new line below the current one.
796
797 delete
798 Deletes the character under the cursor.
799
800 backspace
801 Deletes the character before the cursor.
802
803 recordmacro
804 Starts the recording of keystrokes -- the keystrokes are stored as
805 a macro. When already recording, the recording is stopped.
806
807 runmacro
808 Replays the keystrokes of the last recorded macro.
809
810 undo
811 Undoes the last performed text action (add text, delete text,
812 etc).
813
814 redo
815 Redoes the last undone action (i.e., it undoes an undo).
816
817 refresh
818 Refreshes the screen.
819
820 suspend
821 Suspends the editor and returns control to the shell (until you
822 tell the process to resume execution with fg).
823
824 casesens
825 Toggles whether searching/replacing ignores or respects the case
826 of the given characters.
827
828 regexp
829 Toggles whether searching/replacing uses literal strings or regu‐
830 lar expressions.
831
832 backwards
833 Toggles whether searching/replacing goes forward or backward.
834
835 older
836 Retrieves the previous (earlier) entry at a prompt.
837
838 newer
839 Retrieves the next (later) entry at a prompt.
840
841 flipreplace
842 Toggles between searching for something and replacing something.
843
844 flipgoto
845 Toggles between searching for text and targeting a line number.
846
847 flipexecute
848 Toggles between inserting a file and executing a command.
849
850 flippipe
851 When executing a command, toggles whether the current buffer (or
852 marked region) is piped to the command.
853
854 flipnewbuffer
855 Toggles between inserting into the current buffer and into a new
856 empty buffer.
857
858 flipconvert
859 When reading in a file, toggles between converting and not con‐
860 verting it from DOS/Mac format. Converting is the default.
861
862 dosformat
863 When writing a file, switches to writing a DOS format (CR/LF).
864
865 macformat
866 When writing a file, switches to writing a Mac format.
867
868 append
869 When writing a file, appends to the end instead of overwriting.
870
871 prepend
872 When writing a file, 'prepends' (writes at the beginning) instead
873 of overwriting.
874
875 backup
876 When writing a file, creates a backup of the current file.
877
878 discardbuffer
879 When about to write a file, discard the current buffer without
880 saving. (This function is bound by default only when option
881 --saveonexit is in effect.)
882
883 browser
884 Starts the file browser (in the Read File and Write Out menus),
885 allowing to select a file from a list.
886
887 gotodir
888 Goes to a directory to be specified, allowing to browse anywhere
889 in the filesystem.
890
891 firstfile
892 Goes to the first file in the list when using the file browser.
893
894 lastfile
895 Goes to the last file in the list when using the file browser.
896
897 nohelp
898 Toggles the presence of the two-line list of key bindings at the
899 bottom of the screen. (This toggle is special: it is available in
900 all menus except the help viewer and the linter. All further tog‐
901 gles are available in the main menu only.)
902
903 zero
904 Toggles the presence of title bar and status bar.
905
906 constantshow
907 Toggles the constant display of the current line, column, and
908 character positions.
909
910 softwrap
911 Toggles the displaying of overlong lines on multiple screen lines.
912
913 linenumbers
914 Toggles the display of line numbers in front of the text.
915
916 whitespacedisplay
917 Toggles the showing of whitespace.
918
919 nosyntax
920 Toggles syntax highlighting.
921
922 smarthome
923 Toggles the smartness of the Home key.
924
925 autoindent
926 Toggles whether a newly created line will contain the same amount
927 of leading whitespace as the preceding line -- or as the next line
928 if the preceding line is the beginning of a paragraph.
929
930 cutfromcursor
931 Toggles whether cutting text will cut the whole line or just from
932 the current cursor position to the end of the line.
933
934 breaklonglines
935 Toggles whether long lines will be hard-wrapped to the next line.
936 (The old name of this function, 'nowrap', is deprecated.)
937
938 tabstospaces
939 Toggles whether typed tabs will be converted to spaces.
940
941 mouse
942 Toggles mouse support.
943
944
945 Valid menu sections are:
946
947 main
948 The main editor window where text is entered and edited.
949
950 help
951 The help-viewer menu.
952
953 search
954 The search menu (AKA whereis).
955
956 replace
957 The 'search to replace' menu.
958
959 replacewith
960 The 'replace with' menu, which comes up after 'search to replace'.
961
962 yesno
963 The 'yesno' menu, where the Yes/No/All/Cancel question is asked.
964
965 gotoline
966 The 'goto line (and column)' menu.
967
968 writeout
969 The 'write file' menu.
970
971 insert
972 The 'insert file' menu.
973
974 browser
975 The 'file browser' menu, for selecting a file to be opened or in‐
976 serted or written to.
977
978 whereisfile
979 The 'search for a file' menu in the file browser.
980
981 gotodir
982 The 'go to directory' menu in the file browser.
983
984 execute
985 The menu for inserting the output from an external command, or for
986 filtering the buffer (or the marked region) through an external
987 command, or for executing one of several tools.
988
989 spell
990 The menu of the integrated spell checker where the user can edit a
991 misspelled word.
992
993 linter
994 The linter menu, which allows jumping through the linting mes‐
995 sages.
996
997 all
998 A special name that encompasses all menus. For bind it means all
999 menus where the specified function exists; for unbind it means all
1000 menus where the specified key exists.
1001
1002
1004 /etc/nanorc
1005 System-wide configuration file.
1006
1007 ~/.nanorc or $XDG_CONFIG_HOME/nano/nanorc or ~/.config/nano/nanorc
1008 Per-user configuration file.
1009
1010 /usr/share/nano/*
1011 Syntax definitions for the syntax coloring of common file types
1012 (and for less common file types in the extra/ subdirectory).
1013
1014
1016 nano(1)
1017
1018 https://nano-editor.org/cheatsheet.html
1019 An overview of the default key bindings.
1020
1021
1022
1023August 2022 version 6.4 NANORC(5)