| 1 |
## Sample initialization file for GNU nano. |
| 2 |
## |
| 3 |
## For the options that take parameters, the default value is shown. |
| 4 |
## Other options are unset by default. To make sure that an option |
| 5 |
## is disabled, you can use "unset <option>". |
| 6 |
## |
| 7 |
## Characters that are special in a shell should not be escaped here. |
| 8 |
## Inside string parameters, quotes should not be escaped -- the last |
| 9 |
## double quote on the line will be seen as the closing quote. |
| 10 |
|
| 11 |
## If you want ^F, ^B, M-F and M-B to do what they did before version 8.0: |
| 12 |
# bind ^F forward main |
| 13 |
# bind ^B back main |
| 14 |
# bind M-F formatter main |
| 15 |
# bind M-B linter main |
| 16 |
|
| 17 |
## Make M-< and M-> switch between buffers, as they did before version 9.0: |
| 18 |
# bind M-< prevbuf main |
| 19 |
# bind M-> nextbuf main |
| 20 |
|
| 21 |
## Make 'nextword' (Ctrl+Right) and 'chopwordright' (Ctrl+Delete) |
| 22 |
## stop at word ends instead of at beginnings. |
| 23 |
# set afterends |
| 24 |
|
| 25 |
## When soft line wrapping is enabled, make it wrap lines at blanks |
| 26 |
## (tabs and spaces) instead of always at the edge of the screen. |
| 27 |
# set atblanks |
| 28 |
|
| 29 |
## Automatically indent a newly created line to the same number of |
| 30 |
## tabs and/or spaces as the preceding line -- or as the next line |
| 31 |
## if the preceding line is the beginning of a paragraph. |
| 32 |
# set autoindent |
| 33 |
|
| 34 |
## Back up files to the current filename plus a tilde. |
| 35 |
# set backup |
| 36 |
|
| 37 |
## The directory to put unique backup files in. |
| 38 |
# set backupdir "" |
| 39 |
|
| 40 |
## Use bold text instead of reverse video text. |
| 41 |
# set boldtext |
| 42 |
|
| 43 |
## Treat any line with leading whitespace as the beginning of a paragraph. |
| 44 |
# set bookstyle |
| 45 |
|
| 46 |
## The characters treated as closing brackets when justifying paragraphs. |
| 47 |
## This may not include any blank characters. Only closing punctuation, |
| 48 |
## optionally followed by these closing brackets, can end sentences. |
| 49 |
# set brackets ""')>]}" |
| 50 |
|
| 51 |
## Automatically hard-wrap the current line when it becomes overlong. |
| 52 |
# set breaklonglines |
| 53 |
|
| 54 |
## Do case-sensitive searches by default. |
| 55 |
# set casesensitive |
| 56 |
|
| 57 |
## Interpret digits after a colon after a filename (on the command line) |
| 58 |
## as the line number to go to in that file. |
| 59 |
set colonparsing |
| 60 |
|
| 61 |
## Constantly report the cursor position, in the status bar or minibar. |
| 62 |
# set constantshow |
| 63 |
|
| 64 |
## Use cut-from-cursor-to-end-of-line by default. |
| 65 |
# set cutfromcursor |
| 66 |
|
| 67 |
## Do not use the line below the title bar, leaving it entirely blank. |
| 68 |
# set emptyline |
| 69 |
|
| 70 |
## Set the target width for automatic hard-wrapping and for justifying |
| 71 |
## paragraphs. If the specified value is 0 or less, the wrapping point |
| 72 |
## will be the terminal's width minus this number. |
| 73 |
# set fill -8 |
| 74 |
|
| 75 |
## Draw a vertical stripe at the given column, to help judge text width. |
| 76 |
## (This option does not have a default value.) |
| 77 |
# set guidestripe 75 |
| 78 |
|
| 79 |
## Remember the used search/replace/command strings for the next session. |
| 80 |
set historylog |
| 81 |
|
| 82 |
## Display a "scrollbar" on the righthand side of the edit window. |
| 83 |
# set indicator |
| 84 |
|
| 85 |
## Scroll the buffer contents per half-screen instead of per line. |
| 86 |
# set jumpyscrolling |
| 87 |
|
| 88 |
## Display line numbers to the left (and any anchors in the margin). |
| 89 |
# set linenumbers |
| 90 |
|
| 91 |
## Let other users (of nano or vim) know that you are editing the file |
| 92 |
## they are trying to edit, and the other way around. |
| 93 |
set locking |
| 94 |
|
| 95 |
## Fall back to slow libmagic to try and determine an applicable syntax. |
| 96 |
# set magic |
| 97 |
|
| 98 |
## The opening and closing brackets that are found by a matching-bracket |
| 99 |
## search. This may not contain blank characters. The opening brackets |
| 100 |
## must come before the closing ones, and they must be in the same order. |
| 101 |
# set matchbrackets "(<[{)>]}" |
| 102 |
|
| 103 |
## Suppress the title bar and show the filename plus a cursor-position |
| 104 |
## percentage in the space of the status bar. |
| 105 |
# set minibar |
| 106 |
|
| 107 |
## Enable mouse support, if available for your system. When enabled, |
| 108 |
## mouse clicks can be used to place the cursor, set the mark (with |
| 109 |
## two clicks), and execute shortcuts. The mouse will work in the |
| 110 |
## X Window System, and on the console when gpm is running. |
| 111 |
# set mouse |
| 112 |
|
| 113 |
## Switch on multiple file buffers (inserting a file will put it into |
| 114 |
## a separate buffer). |
| 115 |
# set multibuffer |
| 116 |
|
| 117 |
## Don't convert files from DOS format. |
| 118 |
# set noconvert |
| 119 |
|
| 120 |
## Don't display the helpful shortcut lists at the bottom of the screen. |
| 121 |
# set nohelp |
| 122 |
|
| 123 |
## Don't automatically add a newline when a file does not end with one. |
| 124 |
# set nonewlines |
| 125 |
|
| 126 |
## Set operating directory. nano will not read or write files outside |
| 127 |
## this directory and its subdirectories. Also, the current directory |
| 128 |
## is changed to here, so any files are inserted from this dir. A blank |
| 129 |
## string means the operating-directory feature is turned off. |
| 130 |
# set operatingdir "" |
| 131 |
|
| 132 |
## Remember the position of cursor and anchors for the next editing session. |
| 133 |
# set positionlog |
| 134 |
|
| 135 |
## Preserve the XON and XOFF keys (^Q and ^S). |
| 136 |
# set preserve |
| 137 |
|
| 138 |
## The characters treated as closing punctuation when justifying paragraphs. |
| 139 |
## This may not contain blank characters. Only these terminating characters, |
| 140 |
## optionally followed by closing brackets, can end sentences. |
| 141 |
# set punct "!.?" |
| 142 |
|
| 143 |
## Make status-bar messages disappear after 1 keystroke instead of after 20. |
| 144 |
# set quickblank |
| 145 |
|
| 146 |
## The regular expression that matches quoting characters in email |
| 147 |
## or line-comment introducers in source code. The default is: |
| 148 |
# set quotestr "^([ ]*([!#%:;>|}]|//))+" |
| 149 |
|
| 150 |
## Try to work around a mismatching terminfo terminal description. |
| 151 |
# set rawsequences |
| 152 |
|
| 153 |
## Fix Backspace/Delete confusion problem. |
| 154 |
# set rebinddelete |
| 155 |
|
| 156 |
## Do regular-expression searches by default. |
| 157 |
## Regular expressions are of the extended type (ERE). |
| 158 |
# set regexp |
| 159 |
|
| 160 |
## Save a changed buffer automatically on exit; don't prompt. |
| 161 |
# set saveonexit |
| 162 |
|
| 163 |
## Put the cursor on the highlighted item in the file browser, and |
| 164 |
## show the cursor in the help viewer; useful for people who use a |
| 165 |
## braille display and people with poor vision. |
| 166 |
# set showcursor |
| 167 |
|
| 168 |
## Make the Home key smarter: when Home is pressed anywhere but at the |
| 169 |
## very beginning of non-whitespace characters on a line, the cursor |
| 170 |
## will jump to that beginning (either forwards or backwards). If the |
| 171 |
## cursor is already at that position, it will jump to the true start |
| 172 |
## of the line (the left edge). |
| 173 |
# set smarthome |
| 174 |
|
| 175 |
## Spread overlong lines over multiple screen lines. |
| 176 |
# set softwrap |
| 177 |
|
| 178 |
## Scroll only the current line sideways (instead of all lines). |
| 179 |
# set solosidescroll |
| 180 |
|
| 181 |
## Use this spelling checker instead of the internal one. This option |
| 182 |
## does not have a default value. |
| 183 |
# set speller "aspell -x -c" |
| 184 |
|
| 185 |
## Use the end of the title bar for some state flags: I = auto-indenting, |
| 186 |
## M = mark, L = hard-wrapping long lines, R = recording, S = soft-wrapping. |
| 187 |
set stateflags |
| 188 |
|
| 189 |
## Use this tab size instead of the default; it must be greater than 0. |
| 190 |
# set tabsize 8 |
| 191 |
|
| 192 |
## Convert each typed tab to the fitting number of spaces. |
| 193 |
# set tabstospaces |
| 194 |
|
| 195 |
## Snip whitespace at the end of lines when justifying or hard-wrapping. |
| 196 |
# set trimblanks |
| 197 |
|
| 198 |
## Save files always in Unix format (also when they were DOS). |
| 199 |
# set unix |
| 200 |
|
| 201 |
## The two single-column characters used to display the first characters |
| 202 |
## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode) and 183 in |
| 203 |
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these. |
| 204 |
## The default when in a UTF-8 locale: |
| 205 |
# set whitespace "»·" |
| 206 |
## The default otherwise: |
| 207 |
# set whitespace ">." |
| 208 |
|
| 209 |
## Detect word boundaries differently by treating punctuation |
| 210 |
## characters as parts of words. |
| 211 |
# set wordbounds |
| 212 |
|
| 213 |
## The characters (besides alphanumeric ones) that should be considered |
| 214 |
## as parts of words. This option does not have a default value. When |
| 215 |
## set, it overrides option 'set wordbounds'. |
| 216 |
# set wordchars "<_>." |
| 217 |
|
| 218 |
## Let an unmodified Backspace or Delete erase the marked region (instead |
| 219 |
## of a single character, and without affecting the cutbuffer). |
| 220 |
# set zap |
| 221 |
|
| 222 |
## Hide the bars plus help lines and use the whole terminal as edit area. |
| 223 |
# set zero |
| 224 |
|
| 225 |
|
| 226 |
## Paint the interface elements of nano. These are examples; there are |
| 227 |
## no colors by default, except for errorcolor and spotlightcolor. |
| 228 |
# set titlecolor bold,white,blue |
| 229 |
# set promptcolor lightwhite,grey |
| 230 |
# set statuscolor bold,white,green |
| 231 |
# set errorcolor bold,white,red |
| 232 |
# set spotlightcolor black,lightyellow |
| 233 |
# set selectedcolor lightwhite,#804 |
| 234 |
# set stripecolor ,#444 |
| 235 |
# set scrollercolor slate,#222 |
| 236 |
# set numbercolor cyan |
| 237 |
# set keycolor cyan |
| 238 |
# set functioncolor green |
| 239 |
|
| 240 |
## In root's .nanorc you might want to use: |
| 241 |
# set titlecolor bold,white,magenta |
| 242 |
# set promptcolor black,yellow |
| 243 |
# set statuscolor bold,white,magenta |
| 244 |
# set errorcolor bold,white,red |
| 245 |
# set spotlightcolor black,orange |
| 246 |
# set selectedcolor lightwhite,cyan |
| 247 |
# set stripecolor ,yellow |
| 248 |
# set scrollercolor magenta |
| 249 |
# set numbercolor magenta |
| 250 |
# set keycolor lightmagenta |
| 251 |
# set functioncolor magenta |
| 252 |
|
| 253 |
|
| 254 |
## === Syntax coloring === |
| 255 |
## For all details, see 'man nanorc', section SYNTAX HIGHLIGHTING. |
| 256 |
|
| 257 |
## To include most of the existing syntax definitions, you can do: |
| 258 |
include "/usr/share/nano/*.nanorc" |
| 259 |
|
| 260 |
## Or you can select just the ones you need. For example: |
| 261 |
# include "/usr/share/nano/html.nanorc" |
| 262 |
# include "/usr/share/nano/python.nanorc" |
| 263 |
# include "/usr/share/nano/sh.nanorc" |
| 264 |
|
| 265 |
## In /usr/share/nano/extra/ you can find some syntaxes that are |
| 266 |
## specific for certain distros or for some less common languages. |
| 267 |
|
| 268 |
|
| 269 |
## If <Tab> should always produce four spaces when editing a Python file, |
| 270 |
## independent of the settings of 'tabsize' and 'tabstospaces': |
| 271 |
# extendsyntax python tabgives " " |
| 272 |
|
| 273 |
|
| 274 |
## === Key bindings === |
| 275 |
## For all details, see 'man nanorc', section REBINDING KEYS. |
| 276 |
|
| 277 |
## If you want to suspend nano with one keystroke (instead of with ^T^Z): |
| 278 |
# bind ^Z suspend main |
| 279 |
|
| 280 |
## The <Ctrl+Delete> keystroke deletes the word to the right of the cursor. |
| 281 |
## On some terminals the <Ctrl+Backspace> keystroke produces ^H, which is |
| 282 |
## the ASCII character for backspace, so it is bound by default to the |
| 283 |
## backspace function. The <Backspace> key itself produces a different |
| 284 |
## keycode, which is hard-bound to the backspace function. So, if you |
| 285 |
## normally use <Backspace> for backspacing and not ^H, you can make |
| 286 |
## <Ctrl+Backspace> delete the word to the left of the cursor with: |
| 287 |
# bind ^H chopwordleft main |
| 288 |
|
| 289 |
## For a more mnemonic Comment keystroke (overriding Cut-from-cursor): |
| 290 |
# bind M-K comment main |
| 291 |
|
| 292 |
## If you want ^L to just refresh the screen and not center the cursor: |
| 293 |
# bind ^L refresh main |
| 294 |
|
| 295 |
## When you sometimes type M-J instead of M-K, or M-T instead of M-R: |
| 296 |
# unbind M-J main |
| 297 |
# unbind M-T main |
| 298 |
## (Those functions are still accessible through ^T^J and ^T^V.) |
| 299 |
|
| 300 |
## For quickly uppercasing or lowercasing the word that the cursor is on. |
| 301 |
## (These effectively select a word and pipe it through a sed command.) |
| 302 |
# bind Sh-M-U "{nextword}{mark}{prevword}{execute}| sed 's/.*/\U&/' {enter}" main |
| 303 |
# bind Sh-M-L "{nextword}{mark}{prevword}{execute}| sed 's/.*/\L&/' {enter}" main |
| 304 |
|
| 305 |
## Two ways of copying a marked region to the system clipboard: |
| 306 |
# bind Sh-M-C "{execute}| xsel -ib {enter}{undo}" main |
| 307 |
# bind Sh-M-P "{execute}| xclip -select clipboard 1>&- 2>&- {enter}{undo}" main |
| 308 |
|
| 309 |
## For copying text to the local clipboard via OSC 52 (if terminal supports it): |
| 310 |
# bind M-* "{execute}|| printf "\033]52;c;%s\007" "$(base64 | tr -d '\n')" {enter}{undo}" main |
| 311 |
|
| 312 |
## For normalizing Unicode to precomposed characters: |
| 313 |
# bind Sh-M-N "{execute}| uconv -x nfc {enter}" main |
| 314 |
|
| 315 |
## For wiping all anchors in a buffer: |
| 316 |
# bind Sh-M-W "{execute}| cat {enter}" main |
| 317 |
|
| 318 |
## For snipping trailing blanks when you save a file: |
| 319 |
# bind ^S "{execute}| sed 's/\s\+$//' {enter}{savefile}" main |
| 320 |
|
| 321 |
## If you would like nano to have keybindings that are more "usual", |
| 322 |
## such as ^O for Open, ^F for Find, ^H for Help, and ^Q for Quit, |
| 323 |
## then uncomment these: |
| 324 |
# bind ^X cut main |
| 325 |
# bind ^C copy main |
| 326 |
# bind ^V paste all |
| 327 |
# bind ^Q exit all |
| 328 |
# bind ^S savefile main |
| 329 |
# bind ^W writeout main |
| 330 |
# bind ^O insert main |
| 331 |
# set multibuffer |
| 332 |
# bind ^H help all |
| 333 |
# bind ^H exit help |
| 334 |
# bind ^F whereis all |
| 335 |
# bind ^G findnext all |
| 336 |
# bind ^B wherewas all |
| 337 |
# bind ^D findprevious all |
| 338 |
# bind ^R replace main |
| 339 |
# unbind ^U all |
| 340 |
# unbind ^N main |
| 341 |
# unbind ^Y all |
| 342 |
# unbind M-J main |
| 343 |
# unbind M-T main |
| 344 |
# bind ^A mark main |
| 345 |
# bind ^P location main |
| 346 |
# bind ^T gotoline main |
| 347 |
# bind ^T gotodir browser |
| 348 |
# bind ^T cutrestoffile execute |
| 349 |
# bind ^L linter execute |
| 350 |
# bind ^E execute main |
| 351 |
# bind ^K "{mark}{end}{zap}" main |
| 352 |
# bind ^U "{mark}{home}{zap}" main |
| 353 |
# bind ^Z undo main |
| 354 |
# bind ^Y redo main |