1NANORC(5)                     File Formats Manual                    NANORC(5)
2
3
4

NAME

6       nanorc - GNU nano's configuration file
7
8

DESCRIPTION

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

OPTIONS

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

NOTES

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

SYNTAX HIGHLIGHTING

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       Each regular expression in a nanorc file should be  wrapped  in  double
410       quotes  ("").   Multiple regular expressions can follow each other on a
411       line by separating them with blanks.  This means that a regular expres‐
412       sion  cannot contain a double quote followed by a blank.  When you need
413       this combination inside a regular expression, then  either  the  double
414       quote or the blank should be put between square brackets ([]).
415
416       For  each kind of file a separate syntax can be defined via the follow‐
417       ing commands:
418
419       syntax name ["fileregex" ...]
420              Start the definition of a syntax with this name.  All subsequent
421              color  and other such commands will be added to this syntax, un‐
422              til a new syntax command is encountered.
423
424              When nano is run, this syntax will be automatically activated if
425              the  current  filename  matches  the extended regular expression
426              fileregex.  Or the syntax can be explicitly activated  by  using
427              the -Y or --syntax command-line option followed by the name.
428
429              The  syntax  default  is special: it takes no fileregex, and ap‐
430              plies to files that don't match any syntax's regexes.  The  syn‐
431              tax  none  is reserved; specifying it on the command line is the
432              same as not having a syntax at all.
433
434       header "regex" ...
435              If from all defined syntaxes no fileregex matched, then  compare
436              this  regex  (or  regexes) against the first line of the current
437              file, to determine whether this syntax should be used for it.
438
439       magic "regex" ...
440              If no fileregex matched and no header regex matched either, then
441              compare  this  regex (or regexes) against the result of querying
442              the magic database about the current file, to determine  whether
443              this  syntax  should  be  used for it.  (This functionality only
444              works when libmagic is installed  on  the  system  and  will  be
445              silently ignored otherwise.)
446
447       formatter program [argument ...]
448              Run  the  given program on the full contents of the current buf‐
449              fer.
450
451       linter program [argument ...]
452              Use the given program to run a syntax check on the current  buf‐
453              fer.
454
455       comment "string"
456              Use  the given string for commenting and uncommenting lines.  If
457              the string contains a vertical bar or pipe character  (|),  this
458              designates  bracket-style comments; for example, "/*|*/" for CSS
459              files.  The characters before the pipe are prepended to the line
460              and the characters after the pipe are appended at the end of the
461              line.  If no pipe character  is  present,  the  full  string  is
462              prepended;  for  example, "#" for Python files.  If empty double
463              quotes are specified, the  comment/uncomment  function  is  dis‐
464              abled; for example, "" for JSON.  The default value is "#".
465
466       tabgives "string"
467              Make  the  <Tab>  key produce the given string.  Useful for lan‐
468              guages like Python that want to see only spaces for indentation.
469              This overrides the setting of the tabstospaces option.
470
471       color [bold,][italic,]fgcolor,bgcolor "regex" ...
472              Paint all pieces of text that match the extended regular expres‐
473              sion regex with the given foreground and background  colors,  at
474              least  one  of  which must be specified.  Valid color names are:
475              red, green, blue, magenta, yellow, cyan, white, and black.  Each
476              of  these eight names may be prefixed with the word light to get
477              a brighter version of that color.  The word grey or gray may  be
478              used  as  a  synonym for lightblack.  On terminal emulators that
479              can do at least 256 colors, other valid (but unprefixable) color
480              names  are:  pink, purple, mauve, lagoon, mint, lime, peach, or‐
481              ange, latte, rosy, beet, plum,  sea,  sky,  slate,  teal,  sage,
482              brown,  ocher,  sand, tawny, brick, crimson, and normal -- where
483              normal means the default foreground  or  background  color.   On
484              such emulators, the color may also be specified as a three-digit
485              hexadecimal number prefixed with #, with the digits representing
486              the  amounts  of red, green, and blue, respectively.  This tells
487              nano to select from the available palette the color that approx‐
488              imates the given values.
489
490              The  color pair may be preceded by bold and/or italic (separated
491              by commas) to get a bold and/or slanting typeface, if your  ter‐
492              minal can do those.
493
494              All coloring commands are applied in the order in which they are
495              specified, which means that later  commands  can  recolor  stuff
496              that was colored earlier.
497
498       icolor [bold,][italic,]fgcolor,bgcolor "regex" ...
499              Same as above, except that the matching is case insensitive.
500
501       color [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx"
502              Paint  all  pieces  of text whose start matches extended regular
503              expression fromrx and whose end matches extended regular expres‐
504              sion  torx  with  the given foreground and background colors, at
505              least one of which must be specified.  This means that, after an
506              initial instance of fromrx, all text until the first instance of
507              torx will be colored.  This allows syntax highlighting  to  span
508              multiple lines.
509
510       icolor [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx"
511              Same as above, except that the matching is case insensitive.
512
513       include "syntaxfile"
514              Read  in  self-contained  color  syntaxes from syntaxfile.  Note
515              that syntaxfile may contain only the above commands, from syntax
516              to icolor.
517
518       extendsyntax name command argument ...
519              Extend  the  syntax previously defined as name with another com‐
520              mand.  This allows adding a new color,  icolor,  header,  magic,
521              formatter,  linter,  comment,  or tabgives command to an already
522              defined syntax -- useful when you want  to  slightly  improve  a
523              syntax  defined in one of the system-installed files (which nor‐
524              mally are not writable).
525
526

REBINDING KEYS

528       Key bindings can be changed via the following three commands:
529
530          bind key function menu
531                 Rebinds the given key to the given function in the given menu
532                 (or in all menus where the function exists when all is used).
533
534          bind key "string" menu
535                 Makes  the  given  key  produce the given string in the given
536                 menu (or in all menus where the key exists when all is used).
537                 Besides  literal  text  and/or  control codes, the string may
538                 contain function names between braces.  These functions  will
539                 be invoked when the key is typed.  To include a literal open‐
540                 ing brace, use {{}.
541
542          unbind key menu
543                 Unbinds the given key from the given menu (or from all  menus
544                 where the key exists when all is used).
545
546       Note that bind key "{function}" menu is equivalent to bind key function
547       menu, except that for the latter form nano will check  the  availabilty
548       of  the function in the given menu at startup time (and report an error
549       if it does not exist there), whereas for the first form nano will check
550       at execution time that the function exists but not whether it makes any
551       sense in the current menu.  The user has to take care that  a  function
552       name  between braces (or any sequence of them) is appropriate.  Strange
553       behavior can result when it is not.
554
555
556       The format of key should be one of:
557
558          ^X     where X is a Latin letter, or one of several ASCII characters
559                 (@, ], \, ^, _), or the word "Space".  Example: ^C.
560
561          M-X    where X is any ASCII character except [, or the word "Space".
562                 Example: M-8.
563
564          Sh-M-X where X is a Latin letter.   Example:  Sh-M-U.   By  default,
565                 each Meta+letter keystroke does the same as the corresponding
566                 Shift+Meta+letter.  But when any  Shift+Meta  bind  is  made,
567                 that will no longer be the case, for all letters.
568
569          FN     where N is a numeric value from 1 to 24.  Example: F10.  (Of‐
570                 ten, F13 to F24 can be typed as F1 to F12 with Shift.)
571
572          Ins or Del.
573
574       Rebinding ^M (Enter) or ^I (Tab) is probably not a good idea.   Rebind‐
575       ing  ^[  (Esc) is not possible, because its keycode is the starter byte
576       of Meta keystrokes and escape sequences.  Rebinding any  of  the  dedi‐
577       cated  cursor-moving  keys (the arrows, Home, End, PageUp and PageDown)
578       is not possible.  On some terminals it's not possible to rebind ^H (un‐
579       less  --raw  is  used)  because its keycode is identical to that of the
580       Backspace key.
581
582
583       Valid function names to be bound are:
584
585          help
586            Invokes the help viewer.
587
588          cancel
589            Cancels the current command.
590
591          exit
592            Exits from the program (or from the help viewer or file browser).
593
594          writeout
595            Writes the current buffer to disk, asking for a name.
596
597          savefile
598            Writes the current file to disk without prompting.
599
600          insert
601            Inserts a file into the current buffer (at the current cursor  po‐
602            sition), or into a new buffer when option multibuffer is set.
603
604          whereis
605            Starts  a  forward search for text in the current buffer -- or for
606            filenames matching a string  in  the  current  list  in  the  file
607            browser.
608
609          wherewas
610            Starts  a backward search for text in the current buffer -- or for
611            filenames matching a string  in  the  current  list  in  the  file
612            browser.
613
614          findprevious
615            Searches the next occurrence in the backward direction.
616
617          findnext
618            Searches the next occurrence in the forward direction.
619
620          replace
621            Interactively replaces text within the current buffer.
622
623          cut
624            Cuts and stores the current line (or the marked region).
625
626          copy
627            Copies  the  current  line (or the marked region) without deleting
628            it.
629
630          paste
631            Pastes the currently stored text into the current  buffer  at  the
632            current cursor position.
633
634          zap
635            Throws  away the current line (or the marked region).  (This func‐
636            tion is bound by default to <Meta+Delete>.)
637
638          chopwordleft
639            Deletes from the cursor position to the beginning of the preceding
640            word.   (This function is bound by default to <Shift+Ctrl+Delete>.
641            If your terminal produces ^H for <Ctrl+Backspace>,  you  can  make
642            <Ctrl+Backspace>  delete the word to the left of the cursor by re‐
643            binding ^H to this function.)
644
645          chopwordright
646            Deletes from the cursor position to  the  beginning  of  the  next
647            word.  (This function is bound by default to <Ctrl+Delete>.)
648
649          cutrestoffile
650            Cuts all text from the cursor position till the end of the buffer.
651
652          mark
653            Sets  the  mark  at the current position, to start selecting text.
654            Or, when it is set, unsets the mark.
655
656          location
657            Reports the current position of the  cursor  in  the  buffer:  the
658            line, column, and character positions.
659
660          wordcount
661            Counts  and  reports on the status bar the number of lines, words,
662            and characters in the current buffer (or in the marked region).
663
664          execute
665            Prompts for a program to execute.  The program's  output  will  be
666            inserted into the current buffer (or into a new buffer when M-F is
667            toggled).
668
669          speller
670            Invokes a spell-checking program, either the  default  hunspell(1)
671            or GNU spell(1), or the one defined by --speller or set speller.
672
673          formatter
674            Invokes a full-buffer-processing program (if the active syntax de‐
675            fines one).  (The current buffer is written  out  to  a  temporary
676            file,  the  program  is  run on it, and then the temporary file is
677            read back in, replacing the contents of the buffer.)
678
679          linter
680            Invokes a syntax-checking program (if the  active  syntax  defines
681            one).    If  this  program  produces  lines  of  the  form  "file‐
682            name:linenum:charnum: some message", then the cursor will  be  put
683            at  the  indicated  position  in  the mentioned file while showing
684            "some message" on the status bar.  You can move  from  message  to
685            message  with <PgUp> and <PgDn>, and leave linting mode with ^C or
686            <Enter>.
687
688          justify
689            Justifies the current paragraph (or the marked region).   A  para‐
690            graph is a group of contiguous lines that, apart from possibly the
691            first line, all have the same indentation.   The  beginning  of  a
692            paragraph  is  detected  by either this lone line with a differing
693            indentation or by a preceding blank line.
694
695          fulljustify
696            Justifies the entire current buffer (or the marked region).
697
698          indent
699            Indents (shifts to the right)  the  current  line  or  the  marked
700            lines.
701
702          unindent
703            Unindents  (shifts  to  the  left)  the current line or the marked
704            lines.
705
706          comment
707            Comments or uncomments the current line or the marked lines, using
708            the comment style specified in the active syntax.
709
710          complete
711            Completes (when possible) the fragment before the cursor to a full
712            word found elsewhere in the current buffer.
713
714          left
715            Goes left one position (in the editor or browser).
716
717          right
718            Goes right one position (in the editor or browser).
719
720          up
721            Goes one line up (in the editor or browser).
722
723          down
724            Goes one line down (in the editor or browser).
725
726          scrollup
727            Scrolls the viewport up one row  (meaning  that  the  text  slides
728            down)  while keeping the cursor in the same text position, if pos‐
729            sible.  (This function  is  bound  by  default  to  <Alt+Up>.   If
730            <Alt+Up>  does  nothing  on  your  Linux  console,  see  the  FAQ:
731https://nano-editor.org/dist/latest/faq.html#4.1⟩.)
732
733          scrolldown
734            Scrolls the viewport down one row (meaning that  the  text  slides
735            up)  while keeping the cursor in the same text position, if possi‐
736            ble.  (This function is bound by default to <Alt+Down>.)
737
738          center
739            Scrolls the line with the cursor to the middle of the screen.
740
741          prevword
742            Moves the cursor to the beginning of the previous word.
743
744          nextword
745            Moves the cursor to the beginning of the next word.
746
747          home
748            Moves the cursor to the beginning of the current line.
749
750          end
751            Moves the cursor to the end of the current line.
752
753          beginpara
754            Moves the cursor to the beginning of the current paragraph.
755
756          endpara
757            Moves the cursor to the end of the current paragraph.
758
759          prevblock
760            Moves the cursor to the beginning  of  the  current  or  preceding
761            block of text.  (Blocks are separated by one or more blank lines.)
762
763          nextblock
764            Moves the cursor to the beginning of the next block of text.
765
766          pageup
767            Goes up one screenful.
768
769          pagedown
770            Goes down one screenful.
771
772          firstline
773            Goes to the first line of the file.
774
775          lastline
776            Goes to the last line of the file.
777
778          gotoline
779            Goes  to a specific line (and column if specified).  Negative num‐
780            bers count from the end of the file (and end of the line).
781
782          findbracket
783            Moves the cursor to the bracket (or brace  or  parenthesis,  etc.)
784            that  matches  (pairs)  with  the  one  under the cursor.  See set
785            matchbrackets.
786
787          anchor
788            Places an anchor at the current line, or removes it  when  already
789            present.  (An anchor is visible when line numbers are activated.)
790
791          prevanchor
792            Goes to the first anchor before the current line.
793
794          nextanchor
795            Goes to the first anchor after the current line.
796
797          prevbuf
798            Switches to editing/viewing the previous buffer when multiple buf‐
799            fers are open.
800
801          nextbuf
802            Switches to editing/viewing the next buffer when multiple  buffers
803            are open.
804
805          verbatim
806            Inserts  the next keystroke verbatim into the file, or begins Uni‐
807            code input when a hexadecimal digit is typed.
808
809          tab
810            Inserts a tab at the current cursor location.
811
812          enter
813            Inserts a new line below the current one.
814
815          delete
816            Deletes the character under the cursor.
817
818          backspace
819            Deletes the character before the cursor.
820
821          recordmacro
822            Starts the recording of keystrokes -- the keystrokes are stored as
823            a macro.  When already recording, the recording is stopped.
824
825          runmacro
826            Replays the keystrokes of the last recorded macro.
827
828          undo
829            Undoes  the  last  performed  text  action (add text, delete text,
830            etc).
831
832          redo
833            Redoes the last undone action (i.e., it undoes an undo).
834
835          refresh
836            Refreshes the screen.
837
838          suspend
839            Suspends the editor and returns control to the  shell  (until  you
840            tell the process to resume execution with fg).
841
842          casesens
843            Toggles  whether  searching/replacing ignores or respects the case
844            of the given characters.
845
846          regexp
847            Toggles whether searching/replacing uses literal strings or  regu‐
848            lar expressions.
849
850          backwards
851            Toggles whether searching/replacing goes forward or backward.
852
853          older
854            Retrieves the previous (earlier) entry at a prompt.
855
856          newer
857            Retrieves the next (later) entry at a prompt.
858
859          flipreplace
860            Toggles between searching for something and replacing something.
861
862          flipgoto
863            Toggles between searching for text and targeting a line number.
864
865          flipexecute
866            Toggles between inserting a file and executing a command.
867
868          flippipe
869            When  executing  a command, toggles whether the current buffer (or
870            marked region) is piped to the command.
871
872          flipnewbuffer
873            Toggles between inserting into the current buffer and into  a  new
874            empty buffer.
875
876          flipconvert
877            When  reading  in  a file, toggles between converting and not con‐
878            verting it from DOS/Mac format.  Converting is the default.
879
880          dosformat
881            When writing a file, switches to writing a DOS format (CR/LF).
882
883          macformat
884            When writing a file, switches to writing a Mac format.
885
886          append
887            When writing a file, appends to the end instead of overwriting.
888
889          prepend
890            When writing a file, 'prepends' (writes at the beginning)  instead
891            of overwriting.
892
893          backup
894            When writing a file, creates a backup of the current file.
895
896          discardbuffer
897            When  about  to  write  a file, discard the current buffer without
898            saving.  (This function is  bound  by  default  only  when  option
899            --saveonexit is in effect.)
900
901          browser
902            Starts  the  file  browser (in the Read File and Write Out menus),
903            allowing to select a file from a list.
904
905          gotodir
906            Goes to a directory to be specified, allowing to  browse  anywhere
907            in the filesystem.
908
909          firstfile
910            Goes to the first file in the list when using the file browser.
911
912          lastfile
913            Goes to the last file in the list when using the file browser.
914
915          nohelp
916            Toggles  the  presence of the two-line list of key bindings at the
917            bottom of the screen.  (This toggle is special: it is available in
918            all menus except the help viewer and the linter.  All further tog‐
919            gles are available in the main menu only.)
920
921          zero
922            Toggles the presence of title bar and status bar.
923
924          constantshow
925            Toggles the constant display of  the  current  line,  column,  and
926            character positions.
927
928          softwrap
929            Toggles the displaying of overlong lines on multiple screen lines.
930
931          linenumbers
932            Toggles the display of line numbers in front of the text.
933
934          whitespacedisplay
935            Toggles the showing of whitespace.
936
937          nosyntax
938            Toggles syntax highlighting.
939
940          smarthome
941            Toggles the smartness of the Home key.
942
943          autoindent
944            Toggles  whether a newly created line will contain the same amount
945            of leading whitespace as the preceding line -- or as the next line
946            if the preceding line is the beginning of a paragraph.
947
948          cutfromcursor
949            Toggles  whether cutting text will cut the whole line or just from
950            the current cursor position to the end of the line.
951
952          breaklonglines
953            Toggles whether long lines will be hard-wrapped to the next  line.
954            (The old name of this function, 'nowrap', is deprecated.)
955
956          tabstospaces
957            Toggles whether typed tabs will be converted to spaces.
958
959          mouse
960            Toggles mouse support.
961
962
963       Valid menu sections are:
964
965          main
966            The main editor window where text is entered and edited.
967
968          help
969            The help-viewer menu.
970
971          search
972            The search menu (AKA whereis).
973
974          replace
975            The 'search to replace' menu.
976
977          replacewith
978            The 'replace with' menu, which comes up after 'search to replace'.
979
980          yesno
981            The 'yesno' menu, where the Yes/No/All/Cancel question is asked.
982
983          gotoline
984            The 'goto line (and column)' menu.
985
986          writeout
987            The 'write file' menu.
988
989          insert
990            The 'insert file' menu.
991
992          browser
993            The  'file browser' menu, for selecting a file to be opened or in‐
994            serted or written to.
995
996          whereisfile
997            The 'search for a file' menu in the file browser.
998
999          gotodir
1000            The 'go to directory' menu in the file browser.
1001
1002          execute
1003            The menu for inserting the output from an external command, or for
1004            filtering  the  buffer  (or the marked region) through an external
1005            command, or for executing one of several tools.
1006
1007          spell
1008            The menu of the integrated spell checker where the user can edit a
1009            misspelled word.
1010
1011          linter
1012            The  linter  menu,  which  allows jumping through the linting mes‐
1013            sages.
1014
1015          all
1016            A special name that encompasses all menus.  For bind it means  all
1017            menus where the specified function exists; for unbind it means all
1018            menus where the specified key exists.
1019
1020

FILES

1022       /etc/nanorc
1023              System-wide configuration file.
1024
1025       ~/.nanorc or $XDG_CONFIG_HOME/nano/nanorc or ~/.config/nano/nanorc
1026              Per-user configuration file.
1027
1028       /usr/share/nano/*
1029              Syntax definitions for the syntax coloring of common file  types
1030              (and for less common file types in the extra/ subdirectory).
1031
1032

SEE ALSO

1034       nano(1)
1035
1036       https://nano-editor.org/cheatsheet.html
1037              An overview of the default key bindings.
1038
1039
1040
1041January 2023                      version 7.2                        NANORC(5)
Impressum