{
    "mode": "man",
    "parameter": "nanorc",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/nanorc/5/json",
    "generated": "2026-10-04T22:37:17Z",
    "sections": {
        "NAME": {
            "content": "nanorc - GNU nano's configuration file\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  nanorc files contain the default settings for nano, a small and friendly editor.  During\nstartup, if --rcfile is not given, nano will read two files: first the system-wide  settings,\nfrom  /etc/nanorc  (the exact path might be different on your system), and then the user-spe‐\ncific settings, either from ~/.nanorc or from $XDGCONFIGHOME/nano/nanorc  or  from  ~/.con‐\nfig/nano/nanorc,  whichever  is encountered first.  If --rcfile is given, nano will read just\nthe specified settings file.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The configuration file accepts a series of set and unset commands, which can be used to  con‐\nfigure nano on startup without using command-line options.  Additionally, there are some com‐\nmands  to  define  syntax highlighting and to rebind keys -- see the two separate sections on\nthose.  nano reads one command per line.  All commands and keywords should be written in low‐\nercase.\n\nOptions in nanorc files take precedence over nano's defaults, and command-line options  over‐\nride  nanorc  settings.  Also, options that do not take an argument are unset by default.  So\nusing the unset command is only needed when wanting to override a  setting  of  the  system's\nnanorc file in your own nanorc.  Options that take an argument cannot be unset.\n\nQuotes  inside the characters  parameters below should not be escaped.  The last double quote\non the line will be seen as the closing quote.\n\nThe supported commands and arguments are:\n",
            "subsections": [
                {
                    "name": "set afterends",
                    "content": "Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings.\n"
                },
                {
                    "name": "set allow_insecure_backup",
                    "content": "When backing up files, allow the backup to  succeed  even  if  its  permissions  can't  be\n(re)set  due  to  special OS considerations.  You should NOT enable this option unless you\nare sure you need it.\n"
                },
                {
                    "name": "set atblanks",
                    "content": "When soft line wrapping is enabled, make it wrap  lines  at  blank  characters  (tabs  and\nspaces) instead of always at the edge of the screen.\n"
                },
                {
                    "name": "set autoindent",
                    "content": "Automatically  indent a newly created line to the same number of tabs and/or spaces as the\nprevious line (or as the next line if the previous line is the beginning of a paragraph).\n"
                },
                {
                    "name": "set backup",
                    "content": "When saving a file, create a backup file by adding a tilde (~) to the file's name.\n\nset backupdir directory\nMake and keep not just one backup file, but make and keep a uniquely  numbered  one  every\ntime  a  file is saved -- when backups are enabled with set backup or --backup or -B.  The\nuniquely numbered files are stored in the specified directory.\n"
                },
                {
                    "name": "set boldtext",
                    "content": "Use bold instead of reverse video for the title bar,  status  bar,  key  combos,  function\ntags,  line numbers, and selected text.  This can be overridden by setting the options ti‐\ntlecolor, statuscolor, keycolor, functioncolor, numbercolor, and selectedcolor.\n"
                },
                {
                    "name": "set bookstyle",
                    "content": "When justifying, treat any line that starts with whitespace as the beginning  of  a  para‐\ngraph (unless auto-indenting is on).\n\nset brackets \"characters\"\nSet  the  characters treated as closing brackets when justifying paragraphs.  This may not\ninclude blank characters.  Only closing punctuation (see set punct),  optionally  followed\nby the specified closing brackets, can end sentences.  The default value is \"\"')>]}\".\n"
                },
                {
                    "name": "set breaklonglines",
                    "content": "Automatically hard-wrap the current line when it becomes overlong.\n"
                },
                {
                    "name": "set casesensitive",
                    "content": "Do case-sensitive searches by default.\n"
                },
                {
                    "name": "set constantshow",
                    "content": "Constantly  display  the  cursor  position  in  the status bar.  This overrides the option\nquickblank.\n"
                },
                {
                    "name": "set cutfromcursor",
                    "content": "Use cut-from-cursor-to-end-of-line by default, instead of cutting the whole line.\n"
                },
                {
                    "name": "set emptyline",
                    "content": "Do not use the line below the title bar, leaving it entirely blank.\n\nset errorcolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for the status bar when an error message is displayed.  The de‐\nfault value is bold,white,red.  See set titlecolor for valid color names.\n\nset fill number\nSet the target width for justifying and automatic hard-wrapping at this number of columns.\nIf the value is 0 or less, wrapping will occur at the width of  the  screen  minus  number\ncolumns,  allowing the wrap point to vary along with the width of the screen if the screen\nis resized.  The default value is -8.\n\nset functioncolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for the concise function descriptions in the two help lines  at\nthe bottom of the screen.  See set titlecolor for more details.\n\nset guidestripe number\nDraw  a  vertical  stripe  at the given column, to help judge the width of the text.  (The\ncolor of the stripe can be changed with set stripecolor.)\n"
                },
                {
                    "name": "set historylog",
                    "content": "Save the last hundred search strings and replacement strings  and  executed  commands,  so\nthey can be easily reused in later sessions.\n"
                },
                {
                    "name": "set indicator",
                    "content": "Display  a \"scrollbar\" on the righthand side of the edit window.  It shows the position of\nthe viewport in the buffer and how much of the buffer is covered by the viewport.\n"
                },
                {
                    "name": "set jumpyscrolling",
                    "content": "Scroll the buffer contents per half-screen instead of per line.\n\nset keycolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for the shortcut key combos in the two help lines at the bottom\nof the screen.  See set titlecolor for more details.\n"
                },
                {
                    "name": "set linenumbers",
                    "content": "Display line numbers to the left of the text area.  (Any line with an anchor  additionally\ngets a mark in the margin.)\n"
                },
                {
                    "name": "set locking",
                    "content": "Enable vim-style lock-files for when editing files.\n"
                },
                {
                    "name": "set magic",
                    "content": "When  neither the file's name nor its first line give a clue, try using libmagic to deter‐\nmine the applicable syntax.  (Calling libmagic can be relatively time  consuming.   It  is\ntherefore not done by default.)\n\nset matchbrackets \"characters\"\nSpecify  the opening and closing brackets that can be found by bracket searches.  This may\nnot include blank characters.  The opening set must come before the closing set,  and  the\ntwo sets must be in the same order.  The default value is \"(<[{)>]}\".\n"
                },
                {
                    "name": "set minibar",
                    "content": "Suppress the title bar and instead show information about the current buffer at the bottom\nof  the  screen, in the space for the status bar.  In this \"minibar\" the filename is shown\non the left, followed by an asterisk if the buffer has been modified.  On  the  right  are\ndisplayed  the  current line and column number, the code of the character under the cursor\n(in Unicode format: U+xxxx), the same flags as are shown by set stateflags, and a percent‐\nage that expresses how far the cursor is into the file (linewise).  When a file is  loaded\nor  saved,  and  also when switching between buffers, the number of lines in the buffer is\ndisplayed after the filename.  This number is cleared upon the next keystroke, or replaced\nwith an [i/n] counter when multiple buffers are open.  The line plus  column  numbers  and\nthe character code are displayed only when set constantshow is used, and can be toggled on\nand off with M-C.  The state flags are displayed only when set stateflags is used.\n\nset minicolor [bold,][italic,]fgcolor,bgcolor\nUse  this color combination for the minibar.  (When this option is not specified, the col‐\nors of the title bar are used.)  See set titlecolor for more details.\n"
                },
                {
                    "name": "set mouse",
                    "content": "Enable mouse support, if available for your system.  When enabled,  mouse  clicks  can  be\nused  to place the cursor, set the mark (with a double click), and execute shortcuts.  The\nmouse will work in the X Window System, and on the console when gpm is running.  Text  can\nstill be selected through dragging by holding down the Shift key.\n"
                },
                {
                    "name": "set multibuffer",
                    "content": "When reading in a file with ^R, insert it into a new buffer by default.\n"
                },
                {
                    "name": "set noconvert",
                    "content": "Don't convert files from DOS/Mac format.\n"
                },
                {
                    "name": "set nohelp",
                    "content": "Don't display the two help lines at the bottom of the screen.\n"
                },
                {
                    "name": "set nonewlines",
                    "content": "Don't  automatically add a newline when a text does not end with one.  (This can cause you\nto save non-POSIX text files.)\n"
                },
                {
                    "name": "set nowrap",
                    "content": "Deprecated option since it has become the default setting.  When needed, use unset  break‐\nlonglines instead.\n\nset numbercolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for line numbers.  See set titlecolor for more details.\n\nset operatingdir directory\nnano  will  only  read and write files inside directory and its subdirectories.  Also, the\ncurrent directory is changed to here, so files are inserted from this directory.   By  de‐\nfault, the operating directory feature is turned off.\n"
                },
                {
                    "name": "set positionlog",
                    "content": "Save the cursor position of files between editing sessions.  The cursor position is remem‐\nbered for the 200 most-recently edited files.\n"
                },
                {
                    "name": "set preserve",
                    "content": "Preserve the XON and XOFF keys (^Q and ^S).\n\nset promptcolor [bold,][italic,]fgcolor,bgcolor\nUse  this  color  combination for the prompt bar.  (When this option is not specified, the\ncolors of the title bar are used.)  See set titlecolor for more details.\n\nset punct \"characters\"\nSet the characters treated as closing punctuation when justifying  paragraphs.   This  may\nnot  include  blank  characters.  Only the specfified closing punctuation, optionally fol‐\nlowed by closing brackets (see brackets), can end sentences.  The default value is \"!.?\".\n"
                },
                {
                    "name": "set quickblank",
                    "content": "Make status-bar messages disappear after 1 keystroke instead of after 20.  Note  that  op‐\ntion  constantshow  overrides  this.  When option minibar or zero is in effect, quickblank\nmakes a message disappear after 0.8 seconds instead of after the default 1.5 seconds.\n\nset quotestr \"regex\"\nSet the regular expression for matching the quoting part of a line.  The default value  is\n\"^([ \\t]*([!#%:;>|}]|//))+\".   (Note  that  \\t  stands for an actual Tab character.)  This\nmakes it possible to rejustify blocks of quoted text when composing email, and  to  rewrap\nblocks of line comments when writing source code.\n"
                },
                {
                    "name": "set rawsequences",
                    "content": "Interpret escape sequences directly, instead of asking ncurses to translate them.  (If you\nneed  this  option  to get some keys to work properly, it means that the terminfo terminal\ndescription that is used does not fully match the actual behavior of your terminal.   This\ncan  happen  when  you  ssh  into a BSD machine, for example.)  Using this option disables\nnano's mouse support.\n"
                },
                {
                    "name": "set rebinddelete",
                    "content": "Interpret the Delete and Backspace keys differently so that both Backspace and Delete work\nproperly.  You should only use this option when on your system either Backspace acts  like\nDelete or Delete acts like Backspace.\n"
                },
                {
                    "name": "set regexp",
                    "content": "Do  regular-expression  searches  by  default.  Regular expressions in nano are of the ex‐\ntended type (ERE).\n"
                },
                {
                    "name": "set saveonexit",
                    "content": "Save a changed buffer automatically on exit (^X); don't prompt.\n\nset scrollercolor fgcolor,bgcolor\nUse this color combination for the indicator alias \"scrollbar\".   (On  terminal  emulators\nthat link to a libvte older than version 0.55, using a background color here does not work\ncorrectly.)  See set titlecolor for more details.\n\nset selectedcolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for selected text.  See set titlecolor for more details.\n"
                },
                {
                    "name": "set showcursor",
                    "content": "Put  the  cursor  on  the highlighted item in the file browser, and show the cursor in the\nhelp viewer, to aid braille users and people with poor vision.\n"
                },
                {
                    "name": "set smarthome",
                    "content": "Make the Home key smarter.  When Home is pressed anywhere but at  the  very  beginning  of\nnon-whitespace  characters  on a line, the cursor will jump to that beginning (either for‐\nwards or backwards).  If the cursor is already at that position, it will jump to the  true\nbeginning of the line.\n"
                },
                {
                    "name": "set softwrap",
                    "content": "Display  lines  that  exceed the screen's width over multiple screen lines.  (You can make\nthis soft-wrapping occur at whitespace instead of rudely at the screen's  edge,  by  using\nalso set atblanks.)\n\nset speller \"program [argument ...]\"\nUse  the  given program to do spell checking and correcting, instead of using the built-in\ncorrector that calls hunspell(1) or spell(1).\n\nset spotlightcolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination  for  highlighting  a  search  match.   The  default  value  is\nblack,lightyellow.  See set titlecolor for valid color names.\n"
                },
                {
                    "name": "set stateflags",
                    "content": "Use  the  top-right corner of the screen for showing some state flags: I when auto-indent‐\ning, M when the mark is on, L when hard-wrapping (breaking long lines), R when recording a\nmacro, and S when soft-wrapping.  When the buffer is modified, a star (*) is  shown  after\nthe filename in the center of the title bar.\n\nset statuscolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for the status bar.  See set titlecolor for more details.\n\nset stripecolor [bold,][italic,]fgcolor,bgcolor\nUse  this  color combination for the vertical guiding stripe.  See set titlecolor for more\ndetails.\n\nset tabsize number\nUse a tab size of number columns.  The value of number must be greater than  0.   The  de‐\nfault value is 8.\n"
                },
                {
                    "name": "set tabstospaces",
                    "content": "Convert  each  typed  tab to spaces -- to the number of spaces that a tab at that position\nwould take up.\n\nset titlecolor [bold,][italic,]fgcolor,bgcolor\nUse this color combination for the title bar.  Valid names for the  foreground  and  back‐\nground  colors  are:  red,  green, blue, magenta, yellow, cyan, white, and black.  Each of\nthese eight names may be prefixed with the word light to get a brighter  version  of  that\ncolor.  The word grey or gray may be used as a synonym for lightblack.  On terminal emula‐\ntors  that  can  do  at  least 256 colors, other valid (but unprefixable) color names are:\npink, purple, mauve, lagoon, mint, lime, peach, orange, latte, rosy, beet, plum, sea, sky,\nslate, teal, sage, brown, ocher, sand, tawny, brick, crimson, and normal --  where  normal\nmeans  the  default foreground or background color.  On such emulators, the color may also\nbe specified as a three-digit hexadecimal number prefixed with #, with the  digits  repre‐\nsenting the amounts of red, green, and blue, respectively.  This tells nano to select from\nthe available palette the color that approximates the given values.\n\nEither  \"fgcolor\"  or  \",bgcolor\"  may  be  left out, and the pair may be preceded by bold\nand/or italic (separated by commas) to get a bold and/or slanting typeface, if your termi‐\nnal can do those.\n"
                },
                {
                    "name": "set trimblanks",
                    "content": "Remove trailing whitespace from wrapped lines when automatic hard-wrapping occurs or  when\ntext is justified.\n"
                },
                {
                    "name": "set unix",
                    "content": "Save a file by default in Unix format.  This overrides nano's default behavior of saving a\nfile  in  the format that it had.  (This option has no effect when you also use set nocon‐\nvert.)\n\nset whitespace \"characters\"\nSet the two characters used to indicate the presence of tabs and  spaces.   They  must  be\nsingle-column  characters.  The default pair for a UTF-8 locale is \"»⋅\", and for other lo‐\ncales \">.\".\n"
                },
                {
                    "name": "set wordbounds",
                    "content": "Detect word boundaries differently by treating punctuation characters as parts of words.\n\nset wordchars \"characters\"\nSpecify which other characters (besides the normal alphanumeric ones) should be considered\nas parts of words.  When using this option, you probably want to unset wordbounds.\n"
                },
                {
                    "name": "set zap",
                    "content": "Let an unmodified Backspace or Delete erase the marked region (instead of a single charac‐\nter, and without affecting the cutbuffer).\n"
                },
                {
                    "name": "set zero",
                    "content": "Hide all elements of the interface (title bar, status bar, and help  lines)  and  use  all\nrows  of the terminal for showing the contents of the buffer.  The status bar appears only\nwhen there is a significant message, and disappears after 1.5 seconds  or  upon  the  next\nkeystroke.   With  M-Z  the  title  bar plus status bar can be toggled.  With M-X the help\nlines.\n\n"
                }
            ]
        },
        "NOTES": {
            "content": "Option set suspendable has been removed.  Suspension is enabled  by  default,  reachable  via\n^T^Z.  (If you want a plain ^Z to suspend nano, add bind ^Z suspend main to your nanorc.)\n\n",
            "subsections": []
        },
        "SYNTAX HIGHLIGHTING": {
            "content": "Coloring  the different syntactic elements of a file is done via regular expressions (see the\ncolor command below).  This is inherently imperfect, because regular expressions are not pow‐\nerful enough to fully parse a file.  Nevertheless, regular expressions can do a lot  and  are\neasy to make, so they are a good fit for a small editor like nano.\n\nAll  regular  expressions in nano are POSIX extended regular expressions.  This means that .,\n?, *, +, ^, $, and several other characters are special.  The period  .  matches  any  single\ncharacter,  ? means the preceding item is optional, * means the preceding item may be matched\nzero or more times, + means the preceding item must be matched one or more times,  ^  matches\nthe  beginning  of a line, and $ the end, \\< matches the start of a word, and \\> the end, and\n\\s matches a blank.  It also means that lookahead and lookbehind are not  possible.   A  com‐\nplete explanation can be found in the manual page of GNU grep: man grep.\n\nEach  regular  expression in a nanorc file should be wrapped in double quotes (\"\").  Multiple\nregular expressions can follow each other on a line by separating  them  with  blanks.   This\nmeans  that a regular expression cannot contain a double quote followed by a blank.  When you\nneed this combination inside a regular expression, then either the double quote or the  blank\nshould be put between square brackets ([]).\n\nFor each kind of file a separate syntax can be defined via the following commands:\n\nsyntax name [\"fileregex\" ...]\nStart  the definition of a syntax with this name.  All subsequent color and other such\ncommands will be added to this syntax, until a new syntax command is encountered.\n\nWhen nano is run, this syntax will be automatically activated if the current  filename\nmatches  the  extended  regular expression fileregex.  Or the syntax can be explicitly\nactivated by using the -Y or --syntax command-line option followed by the name.\n\nThe syntax default is special: it takes no fileregex, and applies to files that  don't\nmatch any syntax's regexes.  The syntax none is reserved; specifying it on the command\nline is the same as not having a syntax at all.\n\nheader \"regex\" ...\nIf  from  all  defined  syntaxes  no  fileregex  matched,  then compare this regex (or\nregexes) against the first line of the current file, to determine whether this  syntax\nshould be used for it.\n\nmagic \"regex\" ...\nIf  no  fileregex  matched and no header regex matched either, then compare this regex\n(or regexes) against the result of querying the magic database about the current file,\nto determine whether this syntax should be used  for  it.   (This  functionality  only\nworks  when  libmagic  is  installed on the system and will be silently ignored other‐\nwise.)\n\nformatter program [argument ...]\nRun the given program on the full contents of the current buffer.\n\nlinter program [argument ...]\nUse the given program to run a syntax check on the current buffer.\n\ncomment \"string\"\nUse the given string for commenting and uncommenting lines.  If the string contains  a\nvertical  bar or pipe character (|), this designates bracket-style comments; for exam‐\nple, \"/*|*/\" for CSS files.  The characters before the pipe are prepended to the  line\nand  the  characters  after  the pipe are appended at the end of the line.  If no pipe\ncharacter is present, the full string is prepended; for example, \"#\" for Python files.\nIf empty double quotes are specified, the comment/uncomment function is disabled;  for\nexample, \"\" for JSON.  The default value is \"#\".\n\ntabgives \"string\"\nMake  the  <Tab>  key produce the given string.  Useful for languages like Python that\nwant to see only spaces for indentation.  This overrides the setting  of  the  tabsto‐\nspaces option.\n\ncolor [bold,][italic,]fgcolor,bgcolor \"regex\" ...\nPaint  all  pieces  of  text that match the extended regular expression regex with the\ngiven foreground and background colors, at least  one  of  which  must  be  specified.\nValid  color  names  are:  red,  green, blue, magenta, yellow, cyan, white, and black.\nEach of these eight names may be prefixed with the word light to get a  brighter  ver‐\nsion  of  that  color.  The word grey or gray may be used as a synonym for lightblack.\nOn terminal emulators that can do at least 256 colors, other valid (but  unprefixable)\ncolor  names are: pink, purple, mauve, lagoon, mint, lime, peach, orange, latte, rosy,\nbeet, plum, sea, sky, slate, teal, sage, brown, ocher, sand,  tawny,  brick,  crimson,\nand  normal -- where normal means the default foreground or background color.  On such\nemulators, the color may also be specified as a three-digit  hexadecimal  number  pre‐\nfixed  with  #,  with the digits representing the amounts of red, green, and blue, re‐\nspectively.  This tells nano to select from the available palette the color  that  ap‐\nproximates the given values.\n\nThe  color  pair  may be preceded by bold and/or italic (separated by commas) to get a\nbold and/or slanting typeface, if your terminal can do those.\n\nAll coloring commands are applied in the order in  which  they  are  specified,  which\nmeans that later commands can recolor stuff that was colored earlier.\n\nicolor [bold,][italic,]fgcolor,bgcolor \"regex\" ...\nSame as above, except that the matching is case insensitive.\n\ncolor [bold,][italic,]fgcolor,bgcolor start=\"fromrx\" end=\"torx\"\nPaint  all  pieces  of text whose start matches extended regular expression fromrx and\nwhose end matches extended regular expression torx with the given foreground and back‐\nground colors, at least one of which must be specified.  This  means  that,  after  an\ninitial instance of fromrx, all text until the first instance of torx will be colored.\nThis allows syntax highlighting to span multiple lines.\n\nicolor [bold,][italic,]fgcolor,bgcolor start=\"fromrx\" end=\"torx\"\nSame as above, except that the matching is case insensitive.\n\ninclude \"syntaxfile\"\nRead  in self-contained color syntaxes from syntaxfile.  Note that syntaxfile may con‐\ntain only the above commands, from syntax to icolor.\n\nextendsyntax name command argument ...\nExtend the syntax previously defined as name with another command.  This allows adding\na new color, icolor, header, magic, formatter, linter, comment, or tabgives command to\nan already defined syntax -- useful when you want to slightly improve a syntax defined\nin one of the system-installed files (which normally are not writable).\n\n",
            "subsections": []
        },
        "REBINDING KEYS": {
            "content": "Key bindings can be changed via the following three commands:\n\nbind key function menu\nRebinds the given key to the given function in the given  menu  (or  in  all  menus\nwhere the function exists when all is used).\n\nbind key \"string\" menu\nMakes  the  given  key  produce the given string in the given menu (or in all menus\nwhere the key exists when all is used).  Besides literal text and/or control codes,\nthe string may contain function names between braces.  These functions will be  in‐\nvoked when the key is typed.  To include a literal opening brace, use {{}.\n\nunbind key menu\nUnbinds  the  given key from the given menu (or from all menus where the key exists\nwhen all is used).\n\nNote that bind key \"{function}\" menu is equivalent to bind key function menu, except that for\nthe latter form nano will check the availabilty of the function in the given menu at  startup\ntime  (and  report an error if it does not exist there), whereas for the first form nano will\ncheck at execution time that the function exists but not whether it makes any  sense  in  the\ncurrent menu.  The user has to take care that a function name between braces (or any sequence\nof them) is appropriate.  Strange behavior can result when it is not.\n\n\nThe format of key should be one of:\n\n^X     where  X  is a Latin letter, or one of several ASCII characters (@, ], \\, ^, ), or\nthe word \"Space\".  Example: ^C.\n\nM-X    where X is any ASCII character except [, or the word \"Space\".  Example: M-8.\n\nSh-M-X where X is a Latin letter.  Example: Sh-M-U.  By  default,  each  Meta+letter  key‐\nstroke  does  the  same  as  the  corresponding  Shift+Meta+letter.   But  when any\nShift+Meta bind is made, that will no longer be the case, for all letters.\n\nFN     where N is a numeric value from 1 to 24.  Example: F10.  (Often, F13 to F24 can  be\ntyped as F1 to F12 with Shift.)\n\nIns or Del.\n\nRebinding ^M (Enter) or ^I (Tab) is probably not a good idea.  Rebinding ^[ (Esc) is not pos‐\nsible,  because its keycode is the starter byte of Meta keystrokes and escape sequences.  Re‐\nbinding any of the dedicated cursor-moving keys (the arrows, Home, End, PageUp and  PageDown)\nis not possible.  On some terminals it's not possible to rebind ^H (unless --raw is used) be‐\ncause its keycode is identical to that of the Backspace key.\n\n\nValid function names to be bound are:\n\nhelp\nInvokes the help viewer.\n\ncancel\nCancels the current command.\n\nexit\nExits from the program (or from the help viewer or file browser).\n\nwriteout\nWrites the current buffer to disk, asking for a name.\n\nsavefile\nWrites the current file to disk without prompting.\n\ninsert\nInserts  a  file into the current buffer (at the current cursor position), or into a new\nbuffer when option multibuffer is set.\n\nwhereis\nStarts a forward search for text in the current buffer -- or for  filenames  matching  a\nstring in the current list in the file browser.\n\nwherewas\nStarts  a  backward search for text in the current buffer -- or for filenames matching a\nstring in the current list in the file browser.\n\nfindprevious\nSearches the next occurrence in the backward direction.\n\nfindnext\nSearches the next occurrence in the forward direction.\n\nreplace\nInteractively replaces text within the current buffer.\n\ncut\nCuts and stores the current line (or the marked region).\n\ncopy\nCopies the current line (or the marked region) without deleting it.\n\npaste\nPastes the currently stored text into the current buffer at the current cursor position.\n\nzap\nThrows away the current line (or the marked region).  (This function is bound by default\nto <Meta+Delete>.)\n\nchopwordleft\nDeletes from the cursor position to the beginning of the preceding word.  (This function\nis  bound  by  default  to  <Shift+Ctrl+Delete>.   If  your  terminal  produces  ^H  for\n<Ctrl+Backspace>,  you can make <Ctrl+Backspace> delete the word to the left of the cur‐\nsor by rebinding ^H to this function.)\n\nchopwordright\nDeletes from the cursor position to the beginning of the next word.  (This  function  is\nbound by default to <Ctrl+Delete>.)\n\ncutrestoffile\nCuts all text from the cursor position till the end of the buffer.\n\nmark\nSets the mark at the current position, to start selecting text.  Or, when it is set, un‐\nsets the mark.\n\nlocation\nReports  the current position of the cursor in the buffer: the line, column, and charac‐\nter positions.\n\nwordcount\nCounts and reports on the status bar the number of lines, words, and characters  in  the\ncurrent buffer (or in the marked region).\n\nexecute\nPrompts  for  a program to execute.  The program's output will be inserted into the cur‐\nrent buffer (or into a new buffer when M-F is toggled).\n\nspeller\nInvokes a spell-checking program, either the default hunspell(1) or GNU spell(1), or the\none defined by --speller or set speller.\n\nformatter\nInvokes a full-buffer-processing program (if the active syntax defines one).  (The  cur‐\nrent  buffer  is written out to a temporary file, the program is run on it, and then the\ntemporary file is read back in, replacing the contents of the buffer.)\n\nlinter\nInvokes a syntax-checking program (if the active syntax defines one).  If  this  program\nproduces  lines  of  the  form \"filename:linenum:charnum: some message\", then the cursor\nwill be put at the indicated position in the mentioned file while showing \"some message\"\non the status bar.  You can move from message to message with  <PgUp>  and  <PgDn>,  and\nleave linting mode with ^C or <Enter>.\n\njustify\nJustifies  the current paragraph (or the marked region).  A paragraph is a group of con‐\ntiguous lines that, apart from possibly the first line, all have the  same  indentation.\nThe  beginning  of a paragraph is detected by either this lone line with a differing in‐\ndentation or by a preceding blank line.\n\nfulljustify\nJustifies the entire current buffer (or the marked region).\n\nindent\nIndents (shifts to the right) the current line or the marked lines.\n\nunindent\nUnindents (shifts to the left) the current line or the marked lines.\n\ncomment\nComments or uncomments the current line or the marked lines,  using  the  comment  style\nspecified in the active syntax.\n\ncomplete\nCompletes  (when possible) the fragment before the cursor to a full word found elsewhere\nin the current buffer.\n\nleft\nGoes left one position (in the editor or browser).\n\nright\nGoes right one position (in the editor or browser).\n\nup\nGoes one line up (in the editor or browser).\n\ndown\nGoes one line down (in the editor or browser).\n\nscrollup\nScrolls the viewport up one row (meaning that the text slides down)  while  keeping  the\ncursor  in  the  same text position, if possible.  (This function is bound by default to\n<Alt+Up>.  If <Alt+Up> does nothing on your Linux console, see the FAQ: https://nano-ed‐\nitor.org/dist/latest/faq.html#4.1.)\n\nscrolldown\nScrolls the viewport down one row (meaning that the text slides up)  while  keeping  the\ncursor  in  the  same text position, if possible.  (This function is bound by default to\n<Alt+Down>.)\n\ncenter\nScrolls the line with the cursor to the middle of the screen.\n\nprevword\nMoves the cursor to the beginning of the previous word.\n\nnextword\nMoves the cursor to the beginning of the next word.\n\nhome\nMoves the cursor to the beginning of the current line.\n\nend\nMoves the cursor to the end of the current line.\n\nbeginpara\nMoves the cursor to the beginning of the current paragraph.\n\nendpara\nMoves the cursor to the end of the current paragraph.\n\nprevblock\nMoves the cursor to the beginning of the current or preceding block  of  text.   (Blocks\nare separated by one or more blank lines.)\n\nnextblock\nMoves the cursor to the beginning of the next block of text.\n\npageup\nGoes up one screenful.\n\npagedown\nGoes down one screenful.\n\nfirstline\nGoes to the first line of the file.\n\nlastline\nGoes to the last line of the file.\n\ngotoline\nGoes  to a specific line (and column if specified).  Negative numbers count from the end\nof the file (and end of the line).\n\nfindbracket\nMoves the cursor to the bracket (or brace or parenthesis,  etc.)  that  matches  (pairs)\nwith the one under the cursor.  See set matchbrackets.\n\nanchor\nPlaces an anchor at the current line, or removes it when already present.  (An anchor is\nvisible when line numbers are activated.)\n\nprevanchor\nGoes to the first anchor before the current line.\n\nnextanchor\nGoes to the first anchor after the current line.\n\nprevbuf\nSwitches to editing/viewing the previous buffer when multiple buffers are open.\n\nnextbuf\nSwitches to editing/viewing the next buffer when multiple buffers are open.\n\nverbatim\nInserts  the next keystroke verbatim into the file, or begins Unicode input when a hexa‐\ndecimal digit is typed.\n\ntab\nInserts a tab at the current cursor location.\n\nenter\nInserts a new line below the current one.\n\ndelete\nDeletes the character under the cursor.\n\nbackspace\nDeletes the character before the cursor.\n\nrecordmacro\nStarts the recording of keystrokes -- the keystrokes are stored as a  macro.   When  al‐\nready recording, the recording is stopped.\n\nrunmacro\nReplays the keystrokes of the last recorded macro.\n\nundo\nUndoes the last performed text action (add text, delete text, etc).\n\nredo\nRedoes the last undone action (i.e., it undoes an undo).\n\nrefresh\nRefreshes the screen.\n\nsuspend\nSuspends  the editor and returns control to the shell (until you tell the process to re‐\nsume execution with fg).\n\ncasesens\nToggles whether searching/replacing ignores or respects the case of  the  given  charac‐\nters.\n\nregexp\nToggles whether searching/replacing uses literal strings or regular expressions.\n\nbackwards\nToggles whether searching/replacing goes forward or backward.\n\nolder\nRetrieves the previous (earlier) entry at a prompt.\n\nnewer\nRetrieves the next (later) entry at a prompt.\n\nflipreplace\nToggles between searching for something and replacing something.\n\nflipgoto\nToggles between searching for text and targeting a line number.\n\nflipexecute\nToggles between inserting a file and executing a command.\n\nflippipe\nWhen executing a command, toggles whether the current buffer (or marked region) is piped\nto the command.\n\nflipnewbuffer\nToggles between inserting into the current buffer and into a new empty buffer.\n\nflipconvert\nWhen  reading  in  a file, toggles between converting and not converting it from DOS/Mac\nformat.  Converting is the default.\n\ndosformat\nWhen writing a file, switches to writing a DOS format (CR/LF).\n\nmacformat\nWhen writing a file, switches to writing a Mac format.\n\nappend\nWhen writing a file, appends to the end instead of overwriting.\n\nprepend\nWhen writing a file, 'prepends' (writes at the beginning) instead of overwriting.\n\nbackup\nWhen writing a file, creates a backup of the current file.\n\ndiscardbuffer\nWhen about to write a file, discard the current buffer without saving.   (This  function\nis bound by default only when option --saveonexit is in effect.)\n\nbrowser\nStarts  the  file  browser  (in the Read File and Write Out menus), allowing to select a\nfile from a list.\n\ngotodir\nGoes to a directory to be specified, allowing to browse anywhere in the filesystem.\n\nfirstfile\nGoes to the first file in the list when using the file browser.\n\nlastfile\nGoes to the last file in the list when using the file browser.\n\nnohelp\nToggles the presence of the two-line list of key bindings at the bottom of  the  screen.\n(This  toggle  is  special:  it is available in all menus except the help viewer and the\nlinter.  All further toggles are available in the main menu only.)\n\nzero\nToggles the presence of title bar and status bar.\n\nconstantshow\nToggles the constant display of the current line, column, and character positions.\n\nsoftwrap\nToggles the displaying of overlong lines on multiple screen lines.\n\nlinenumbers\nToggles the display of line numbers in front of the text.\n\nwhitespacedisplay\nToggles the showing of whitespace.\n\nnosyntax\nToggles syntax highlighting.\n\nsmarthome\nToggles the smartness of the Home key.\n\nautoindent\nToggles whether a newly created line will contain the same amount of leading  whitespace\nas the preceding line -- or as the next line if the preceding line is the beginning of a\nparagraph.\n\ncutfromcursor\nToggles whether cutting text will cut the whole line or just from the current cursor po‐\nsition to the end of the line.\n\nbreaklonglines\nToggles whether long lines will be hard-wrapped to the next line.  (The old name of this\nfunction, 'nowrap', is deprecated.)\n\ntabstospaces\nToggles whether typed tabs will be converted to spaces.\n\nmouse\nToggles mouse support.\n\n\nValid menu sections are:\n\nmain\nThe main editor window where text is entered and edited.\n\nhelp\nThe help-viewer menu.\n\nsearch\nThe search menu (AKA whereis).\n\nreplace\nThe 'search to replace' menu.\n\nreplacewith\nThe 'replace with' menu, which comes up after 'search to replace'.\n\nyesno\nThe 'yesno' menu, where the Yes/No/All/Cancel question is asked.\n\ngotoline\nThe 'goto line (and column)' menu.\n\nwriteout\nThe 'write file' menu.\n\ninsert\nThe 'insert file' menu.\n\nbrowser\nThe 'file browser' menu, for selecting a file to be opened or inserted or written to.\n\nwhereisfile\nThe 'search for a file' menu in the file browser.\n\ngotodir\nThe 'go to directory' menu in the file browser.\n\nexecute\nThe  menu for inserting the output from an external command, or for filtering the buffer\n(or the marked region) through an external command, or  for  executing  one  of  several\ntools.\n\nspell\nThe menu of the integrated spell checker where the user can edit a misspelled word.\n\nlinter\nThe linter menu, which allows jumping through the linting messages.\n\nall\nA special name that encompasses all menus.  For bind it means all menus where the speci‐\nfied function exists; for unbind it means all menus where the specified key exists.\n\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/nanorc\nSystem-wide configuration file.\n\n~/.nanorc or $XDGCONFIGHOME/nano/nanorc or ~/.config/nano/nanorc\nPer-user configuration file.\n\n/usr/share/nano/*\nSyntax  definitions  for the syntax coloring of common file types (and for less common\nfile types in the extra/ subdirectory).\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "nano(1)\n\nhttps://nano-editor.org/cheatsheet.html\nAn overview of the default key bindings.\n\nJanuary 2023                                 version 7.2                                   NANORC(5)",
            "subsections": []
        }
    },
    "summary": "nanorc - GNU nano's configuration file",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "nano",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/nano/1/json"
        }
    ]
}