NANORC(5) NANORC(5) (NAME) nanorc - (GNU nano) (DESCRIPTION) nanorc nano . --rcfile nano : /etc/nanorc ( ) ~/.nanorc $XDG_CONFIG_HOME/nano/nanorc ~/.config/nano/nanorc ( ). --rcfile nano . (NOTICE) 8.0 ^F ^B M-F M-B . 8.0 nanorc : bind ^F forward main bind ^B back main bind M-F formatter main bind M-B linter main (OPTIONS) set unset nano . (syntax highlighting) -- . nano . . nanorc nano nanorc . (unset) . unset nanorc nanorc . unset . characters . . : set afterends Ctrl+Right Ctrl+Delete . set allow_insecure_backup . . set atblanks (soft line wrapping) ( ) . set autoindent / ( ). set backup (~) . set backupdir directory -- set backup --backup -B . directory . set boldtext (reverse video) (bold) (mini bar) . titlecolor statuscolor promptcolor minicolor keycolor numbercolor / selectedcolor . set bookstyle (justifying) ( ). set brackets "characters" . . ( set punct) . ""')>]}" . set breaklonglines (hard-wrap). set casesensitive . set colonparsing . . . +1 . set constantshow . quickblank . set cutfromcursor . set emptyline . set errorcolor [bold,][italic,]fgcolor,bgcolor . bold,white,red . set titlecolor . set fill number number . 0 number . -8 . set functioncolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set guidestripe number . ( set stripecolor .) set historylog . set indicator << >> (scrollbar) . . set jumpyscrolling . set keycolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set linenumbers . ( .) set locking vim . set magic libmagic . ( libmagic .) set matchbrackets "characters" . . . "(<[{)>]}" . set minibar . << >> (mini bar) . ( : U+xxxx) set stateflags ( ) . . [i/n] . set constantshow M-C . set stateflags . set minicolor [bold,][italic,]fgcolor,bgcolor . ( .) set titlecolor . set mouse . ( ) . X gpm . Shift . set multibuffer ^R . set noconvert DOS/Mac . set nohelp . set nonewlines (newline) . ( POSIX .) set nowrap . unset breaklonglines . set numbercolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set operatingdir directory nano directory . . . set positionlog . . set preserve XOFF XON ( ^S ^Q) ( ). set promptcolor [bold,][italic,]fgcolor,bgcolor . ( .) set titlecolor . set punct "characters" . . ( set brackets) . "!.?" . set quickblank . constantshow . minibar zero quickblank . set quotestr "regex" . "^([ \t]*([!#%:;>|}]|//))+" . ( \t .) . set rawsequences (escape sequences) ncurses . ( terminfo ssh BSD .) nano . set rebinddelete Delete Backspace Backspace Delete . Backspace Delete Delete Backspace . set regexp . nano (ERE) . set saveonexit (^X) . set scrollercolor fgcolor,bgcolor << >> . set titlecolor . set selectedcolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set showcursor . set smarthome Home . Home ( ). . set softwrap . ( set atblanks .) set speller "program [argument ...]" hunspell(1) spell(1) program . set spotlightcolor [bold,][italic,]fgcolor,bgcolor . black,lightyellow . set titlecolor . set stateflags : I M L ( ) R S . (*) . set statuscolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set stripecolor [bold,][italic,]fgcolor,bgcolor . set titlecolor . set tabsize number number . number 0 . 8 . set tabstospaces -- . (: .) set titlecolor [bold,][italic,]fgcolor,bgcolor . : red, green, blue, magenta, yellow, cyan, white, black. light . grey gray lightblack . light . ( ) : pink, purple, mauve, lagoon, mint, lime, peach, orange, latte, rosy, beet, plum, sea, sky, slate, teal, sage, brown, ocher, sand, tawny, brick, crimson, normal -- normal . # . nano . "fgcolor" ",bgcolor" bold / italic ( ) / . set trimblanks . set unix . nano . ( set noconvert .) set whitespace "characters" . . UTF-8 ">>." ">.". set wordbounds . set wordchars "characters" ( - ) . wordbounds . set zap Backspace Delete ( ). set zero ( ) . . M-Z / . M-X . (SYNTAX HIGHLIGHTING) ( color ). (parse) . nano . nano (POSIX extended regular expressions) . . ? * + ^ $ . . ? * + ^ $ \< \> \s . (lookahead) (lookbehind) . GNU grep : man grep. nanorc ("") . . . ([]) . : syntax name ["fileregex" ...] name . color syntax . nano fileregex ( ) . -Y --syntax name ( ) . default : fileregex . none . header "regex" ... fileregex regex ( ) . magic "regex" ... fileregex header regex ( ) magic . ( libmagic --magic set magic .) formatter program [argument ...] program . linter program [argument ...] program . comment "string" string () . (|) "/*|*/" CSS. . "#" Python. / "" JSON. "#" . tabgives "string" string . Python . tabstospaces . color [bold,][italic,]fgcolor,bgcolor "regex" ... regex . : red, green, blue, magenta, yellow, cyan, white, black. light . grey gray lightblack . light . ( ) : pink, purple, mauve, lagoon, mint, lime, peach, orange, latte, rosy, beet, plum, sea, sky, slate, teal, sage, brown, ocher, sand, tawny, brick, crimson, normal -- normal . # . nano . bold / italic ( ) / . . icolor [bold,][italic,]fgcolor,bgcolor "regex" ... (case insensitive) . color [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx" fromrx torx . fromrx torx . . icolor [bold,][italic,]fgcolor,bgcolor start="fromrx" end="torx" . include "syntaxfile" syntaxfile . syntaxfile syntax icolor . extendsyntax name command argument ... name command . color icolor header magic formatter linter comment tabgives -- ( ) . (REBINDING KEYS) : bind key function menu key function menu ( all ). bind key "string" menu key string menu ( all ). / string . . {{} . unbind key menu key menu ( all ). bind key "{function}" menu bind key function menu nano function menu ( ) nano function . ( ) . . key : ^X X ASCII (@ ] \ ^ _) "Space" . : ^C. M-X X ASCII [ "Space" . : M-8. Sh-M-X X . : Sh-M-U. Meta+letter Shift+Meta+letter . Shift+Meta . FN N 1 24 . : F10. ( F13 F24 F1 F12 Shift .) Ins Del. ^M () ^I () . ^[ () . ( Home End PageUp PageDown) . ^H ( --raw ) Backspace . function : help . cancel . exit ( ) . writeout . savefile . insert ( ) multibuffer . whereis -- . wherewas -- . findprevious ( ) . findnext ( ) . replace . cut ( ) . copy ( ) () . paste (paste). zap ( ) ( ). ( .) chopwordleft . ( . ^H ^H .) chopwordright . ( .) cutrestoffile . mark . location : . wordcount ( ) . execute . ( M-F ). speller hunspell(1) GNU spell(1) --speller set speller . formatter ( ). ( .) linter ( ). "filename:linenum:charnum: some message" "some message" . ^C . justify ( ) . . . fulljustify ( ) . indent ( ). unindent ( ). comment . complete . left ( ). right ( ). up ( ). down ( ). scrollup ( ) . ( . : .) scrolldown ( ) . ( .) center . cycle . prevword . nextword . home . end . beginpara . endpara . prevblock . ( .) nextblock . toprow . bottomrow . pageup . pagedown . firstline . lastline . gotoline ( ) . ( ) . findbracket ( ) . set matchbrackets. anchor . ( .) prevanchor . nextanchor . prevbuf / . nextbuf / . verbatim . tab . enter . delete . backspace . recordmacro -- . . runmacro . undo (undo) ( ). redo (redo) ( undo ). refresh (refresh) . suspend ( fg ). casesens / . regexp / . backwards / . older () . newer () . flipreplace . flipgoto . flipexecute . flippipe ( ) . flipnewbuffer . flipconvert DOS/Mac . . dosformat DOS (CR/LF) . macformat Mac . append (append). prepend (prepend). backup . discardbuffer . ( --saveonexit .) browser ( Read File Write Out) . gotodir . firstfile . lastfile . nohelp . ( : linter . .) zero . constantshow ( ) . softwrap . linenumbers . whitespacedisplay . nosyntax . smarthome Home . autoindent -- -- . cutfromcursor -- . breaklonglines . tabstospaces . mouse . (menu) : main . help . search ( whereis). replace << >>. replacewith << >> << >> . yesno <> Yes/No/All/Cancel . gotoline << ( )>>. writeout << >>. insert << >>. browser << >> . whereisfile << >> . gotodir << >> . execute ( ) . spell . linter linter . all . bind function unbind key . (EXAMPLES) Ctrl+Z : bind ^Z suspend main Shift+Alt+C : bind Sh-M-C "{execute}| xsel -ib {enter}{undo}" main (FILES) /etc/nanorc . ~/.nanorc $XDG_CONFIG_HOME/nano/nanorc ~/.config/nano/nanorc . /usr/share/nano/* ( extra/). (SEE ALSO) nano(1) https://nano-editor.org/cheatsheet.html . 2025 8.4 NANORC(5)