| 1 |
.\" Copyright (C) 1999-2011, 2013-2026 Free Software Foundation, Inc. |
| 2 |
.\" |
| 3 |
.\" This document is dual-licensed. You may distribute and/or modify it |
| 4 |
.\" under the terms of either of the following licenses: |
| 5 |
.\" |
| 6 |
.\" * The GNU General Public License, as published by the Free Software |
| 7 |
.\" Foundation, version 3 or (at your option) any later version. You |
| 8 |
.\" should have received a copy of the GNU General Public License |
| 9 |
.\" along with this program. If not, see |
| 10 |
.\" <https://www.gnu.org/licenses/>. |
| 11 |
.\" |
| 12 |
.\" * The GNU Free Documentation License, as published by the Free |
| 13 |
.\" Software Foundation, version 1.2 or (at your option) any later |
| 14 |
.\" version, with no Invariant Sections, no Front-Cover Texts, and no |
| 15 |
.\" Back-Cover Texts. You should have received a copy of the GNU Free |
| 16 |
.\" Documentation License along with this program. If not, see |
| 17 |
.\" <https://www.gnu.org/licenses/>. |
| 18 |
.\" |
| 19 |
.TH NANO 1 "version 9.0" "April 2026" |
| 20 |
|
| 21 |
.SH NAME |
| 22 |
nano \- Nano's ANOther text editor, inspired by Pico |
| 23 |
|
| 24 |
.SH SYNOPSIS |
| 25 |
.B nano |
| 26 |
.RI [ options "] [[\fB+" line [\fB, column "]] " file ]... |
| 27 |
.sp |
| 28 |
.BR nano " [" \fIoptions "] [[" + [ crCR ]{ / | ? } \fIstring "] " \fIfile ]... |
| 29 |
|
| 30 |
.SH NOTICES |
| 31 |
Since version 9.0, all lines are scrolled horizontally together |
| 32 |
(when the cursor approaches the edge), by just the amount needed, |
| 33 |
instead of scrolling only the current line by a large step. |
| 34 |
If you prefer the old behavior, you can use \fB--solo\fR on the |
| 35 |
command line or \fBset solosidescroll\fR in your \fInanorc\fR. |
| 36 |
.sp |
| 37 |
Also since version 9.0, keystrokes \fBM-<\fR and \fBM->\fR have |
| 38 |
been reassigned to the `scrollleft` and `scrollright` functions. |
| 39 |
If you want those keystrokes to do what they did before version 9.0, |
| 40 |
add these two lines at the end of your \fInanorc\fR file: |
| 41 |
.sp |
| 42 |
.RS 4 |
| 43 |
.B bind M\-< prevbuf main |
| 44 |
.br |
| 45 |
.B bind M\-> nextbuf main |
| 46 |
.RE |
| 47 |
.sp |
| 48 |
Since version 8.0, to be newcomer friendly, \fB^F\fR starts a forward search, |
| 49 |
\fB^B\fR starts a backward search, \fBM\-F\fR searches the next occurrence |
| 50 |
forward, and \fBM\-B\fR searches the next occurrence backward. If you want |
| 51 |
those keystrokes to do what they did before version 8.0, add the following |
| 52 |
four lines at the end of your \fInanorc\fR file: |
| 53 |
.sp |
| 54 |
.RS 4 |
| 55 |
.B bind ^F forward main |
| 56 |
.br |
| 57 |
.B bind ^B back main |
| 58 |
.br |
| 59 |
.B bind M\-F formatter main |
| 60 |
.br |
| 61 |
.B bind M\-B linter main |
| 62 |
.RE |
| 63 |
.sp |
| 64 |
|
| 65 |
.SH DESCRIPTION |
| 66 |
\fBnano\fR is a small and friendly text editor. It copies the look and feel |
| 67 |
of Pico, but is free software, and implements several features that Pico |
| 68 |
lacks, such as: opening multiple files, scrolling per line, undo/redo, |
| 69 |
syntax coloring, line numbering, and soft-wrapping overlong lines. |
| 70 |
.sp |
| 71 |
When giving a filename on the command line, the cursor can be put on a |
| 72 |
specific line by adding the line number with a plus sign (\fB+\fR) before |
| 73 |
the filename, and even in a specific column by adding it with a comma. |
| 74 |
Negative numbers count from the end of the file or line. |
| 75 |
.sp |
| 76 |
The cursor can be put on the first or last occurrence of a specific string |
| 77 |
by specifying that string after \fB+/\fR or \fB+?\fR before the filename. |
| 78 |
The string can be made case sensitive and/or caused to be interpreted as a |
| 79 |
regular expression by inserting \fBc\fR and/or \fBr\fR after the \fB+\fR sign. |
| 80 |
These search modes can be explicitly disabled by using the uppercase variant |
| 81 |
of those letters: \fBC\fR and/or \fBR\fR. When the string contains spaces, |
| 82 |
it needs to be enclosed in quotes. To give an example: to open a file at |
| 83 |
the first occurrence of the word "Foo", you would do: |
| 84 |
.sp |
| 85 |
.RS 4 |
| 86 |
.BI "nano +c/Foo " file |
| 87 |
.RE |
| 88 |
.sp |
| 89 |
As a special case: if instead of a filename a dash (\fB\-\fR) is given, |
| 90 |
\fBnano\fR will read data from standard input. |
| 91 |
|
| 92 |
.SH EDITING |
| 93 |
Entering text and moving around in a file is straightforward: typing the |
| 94 |
letters and using the normal cursor movement keys. Commands are entered |
| 95 |
by using the Control (^) and the Alt or Meta (M\-) keys. |
| 96 |
Typing \fB^K\fR deletes the current line and puts it in the cutbuffer. |
| 97 |
Consecutive \fB^K\fRs put all deleted lines together in the cutbuffer. |
| 98 |
Any cursor movement or executing any other command causes the next |
| 99 |
\fB^K\fR to overwrite the cutbuffer. A \fB^U\fR pastes the current |
| 100 |
contents of the cutbuffer at the current cursor position. |
| 101 |
.sp |
| 102 |
When a more precise piece of text needs to be cut or copied, you can mark |
| 103 |
its start with \fB^6\fR, move the cursor to its end (the marked text is |
| 104 |
highlighted), and then use \fB^K\fR to cut it, or \fBM\-6\fR to copy it to |
| 105 |
the cutbuffer. You can also save the marked text to a file with \fB^O\fR, |
| 106 |
or spell check it with \fB^T^T\fR. |
| 107 |
.sp |
| 108 |
On some terminals, text can be selected also by holding down Shift while |
| 109 |
using the arrow keys. Holding down the Ctrl or Alt key too increases |
| 110 |
the stride. |
| 111 |
Any cursor movement without Shift being held cancels such a selection. |
| 112 |
.sp |
| 113 |
Any valid Unicode code point can be inserted into the buffer by typing |
| 114 |
\fBM\-V\fR followed by the hexadecimal digits of the code point (concluded |
| 115 |
with \fB<Space>\fR or \fB<Enter>\fR when it are fewer than six digits). |
| 116 |
A literal control code (except \fB^J\fR) can be inserted by typing |
| 117 |
\fBM\-V\fR followed by the pertinent keystroke. |
| 118 |
.sp |
| 119 |
The two lines at the bottom of the screen show some important commands; |
| 120 |
the built-in help (\fB^G\fR) lists all the available ones. |
| 121 |
The default key bindings can be changed via a \fInanorc\fR file \(em see |
| 122 |
.BR nanorc (5). |
| 123 |
|
| 124 |
.\" Never hyphenate these: |
| 125 |
.hw ncurses terminfo |
| 126 |
|
| 127 |
.SH OPTIONS |
| 128 |
.TP |
| 129 |
.BR \-A ", " \-\-smarthome |
| 130 |
Make the Home key smarter. When Home is pressed anywhere but at the |
| 131 |
very beginning of non-whitespace characters on a line, the cursor jumps |
| 132 |
to that beginning (either forwards or backwards). If the cursor is |
| 133 |
already at that position, it jumps to the true beginning of the line. |
| 134 |
.TP |
| 135 |
.BR \-B ", " \-\-backup |
| 136 |
When saving a file, back up the previous version of it, using the current |
| 137 |
filename suffixed with a tilde (\fB~\fR). |
| 138 |
.TP |
| 139 |
.BI \-C " directory\fR, " \-\-backupdir= directory |
| 140 |
Make and keep not just one backup file, but make and keep a uniquely numbered |
| 141 |
one every time a file is saved \(em when backups are enabled (\fB\-B\fR). |
| 142 |
The uniquely numbered files are stored in the specified \fIdirectory\fR. |
| 143 |
.TP |
| 144 |
.BR \-D ", " \-\-boldtext |
| 145 |
For the interface, use bold instead of reverse video. |
| 146 |
This can be overridden for specific elements by setting the options |
| 147 |
\fB\%titlecolor\fR, \fB\%statuscolor\fR, \fB\%promptcolor\fR, |
| 148 |
\fB\%minicolor\fR, \fB\%keycolor\fR, \fB\%numbercolor\fR, and/or |
| 149 |
\fB\%selectedcolor\fR in your nanorc file. See \fBnanorc\fR(5). |
| 150 |
.TP |
| 151 |
.BR \-E ", " \-\-tabstospaces |
| 152 |
Convert each typed tab to spaces \(em to the number of spaces |
| 153 |
that a tab at that position would take up. |
| 154 |
(Note: pasted tabs are not converted.) |
| 155 |
.TP |
| 156 |
.BR \-F ", " \-\-multibuffer |
| 157 |
Read a file into a new buffer by default. |
| 158 |
.TP |
| 159 |
.BR \-G ", " \-\-locking |
| 160 |
Use vim-style file locking when editing files. |
| 161 |
.TP |
| 162 |
.BR \-H ", " \-\-historylog |
| 163 |
Save the last hundred search strings and replacement strings and |
| 164 |
executed commands, so they can be easily reused in later sessions. |
| 165 |
.TP |
| 166 |
.BR \-I ", " \-\-ignorercfiles |
| 167 |
Don't look at the system's \fInanorc\fR nor at the user's \fInanorc\fR. |
| 168 |
.TP |
| 169 |
.BI \-J " number\fR, " \-\-guidestripe= number |
| 170 |
Draw a vertical stripe at the given column, to help judge the width of the |
| 171 |
text. (The color of the stripe can be changed with \fBset \%stripecolor\fR |
| 172 |
in your \fInanorc\fR file.) |
| 173 |
.TP |
| 174 |
.BR \-K ", " \-\-rawsequences |
| 175 |
Interpret escape sequences directly, instead of asking \fBncurses\fR |
| 176 |
to translate them. (If you need this option to get some keys to work |
| 177 |
properly, it means that the \fBterminfo\fR terminal description that |
| 178 |
is used does not fully match the actual behavior of your terminal. |
| 179 |
This can happen when you ssh into a BSD machine, for example.) |
| 180 |
Using this option disables \fBnano\fR's mouse support. |
| 181 |
.TP |
| 182 |
.BR \-L ", " \-\-nonewlines |
| 183 |
Don't automatically add a newline when a text does not end with one. |
| 184 |
(This can cause you to save non-POSIX text files.) |
| 185 |
.TP |
| 186 |
.BR \-M ", " \-\-trimblanks |
| 187 |
Snip trailing whitespace from the wrapped line when automatic |
| 188 |
hard-wrapping occurs or when text is justified. |
| 189 |
.TP |
| 190 |
.BR \-N ", " \-\-noconvert |
| 191 |
Disable automatic conversion of files from DOS/Mac format. |
| 192 |
.TP |
| 193 |
.BR \-O ", " \-\-bookstyle |
| 194 |
When justifying, treat any line that starts with whitespace as the |
| 195 |
beginning of a paragraph (unless auto-indenting is on). |
| 196 |
.TP |
| 197 |
.BR \-P ", " \-\-positionlog |
| 198 |
For the 200 most recent files, log the last position of the cursor, |
| 199 |
and place it at that position again upon reopening such a file. |
| 200 |
Also save and restore the positions of any anchors. |
| 201 |
.TP |
| 202 |
.BI "\-Q """ regex\fB"\fR, " \-\-quotestr=""" regex """" |
| 203 |
Set the regular expression for matching the quoting part of a line. |
| 204 |
The default value is "\fB^([\ \\t]*([!#%:;>|}]|//))+\fR". |
| 205 |
(Note that \fB\\t\fR stands for an actual Tab.) |
| 206 |
This makes it possible to rejustify blocks of quoted text when composing |
| 207 |
email, and to rewrap blocks of line comments when writing source code. |
| 208 |
.TP |
| 209 |
.BR \-R ", " \-\-restricted |
| 210 |
Restricted mode: don't read or write to any file not specified on the |
| 211 |
command line. This means: don't read or write history files; |
| 212 |
don't allow suspending; don't allow spell checking; |
| 213 |
don't allow a file to be appended to, prepended to, or saved under a |
| 214 |
different name if it already has one; and don't make backup files. |
| 215 |
Restricted mode can also be activated by invoking \fBnano\fR |
| 216 |
with any name beginning with 'r' (e.g.\& "rnano"). |
| 217 |
.TP |
| 218 |
.BR \-S ", " \-\-softwrap |
| 219 |
Display over multiple screen rows lines that exceed the screen's width. |
| 220 |
(You can make this soft-wrapping occur at whitespace instead of rudely at |
| 221 |
the screen's edge, by using also \fB\-\-atblanks\fR.) |
| 222 |
.TP |
| 223 |
.BI \-T " number\fR, " \-\-tabsize= number |
| 224 |
Set the size (width) of a tab to \fInumber\fR columns. The value of |
| 225 |
\fInumber\fR must be greater than 0. The default value is \fB8\fR. |
| 226 |
.TP |
| 227 |
.BR \-U ", " \-\-quickblank |
| 228 |
Make status-bar messages disappear after 1 keystroke instead of after 20. |
| 229 |
Note that option \fB\-c\fR (\fB\-\-constantshow\fR) overrides this. |
| 230 |
When option \fB\-\-minibar\fR or \fB\-\-zero\fR is in effect, |
| 231 |
\fB\-\-quickblank\fR makes a message disappear after |
| 232 |
0.8 seconds instead of after the default 1.5 seconds. |
| 233 |
. |
| 234 |
.TP |
| 235 |
.BR \-V ", " \-\-version |
| 236 |
Show the current version number and exit. |
| 237 |
.TP |
| 238 |
.BR \-W ", " \-\-wordbounds |
| 239 |
Detect word boundaries differently by treating punctuation |
| 240 |
characters as part of a word. |
| 241 |
.TP |
| 242 |
.BI "\-X """ characters\fB"\fR, " \-\-wordchars=""" characters """" |
| 243 |
Specify which other characters (besides the normal alphanumeric ones) |
| 244 |
should be considered as part of a word. When using this option, you |
| 245 |
probably want to omit \fB\-W\fR (\fB\-\-wordbounds\fR). |
| 246 |
.TP |
| 247 |
.BI \-Y " name\fR, " \-\-syntax= name |
| 248 |
Specify the name of the syntax highlighting to use from among the ones |
| 249 |
defined in the \fInanorc\fR files. |
| 250 |
.TP |
| 251 |
.BR \-Z ", " \-\-zap |
| 252 |
Let an unmodified Backspace or Delete erase the marked region |
| 253 |
(instead of a single character, and without affecting the cutbuffer). |
| 254 |
.TP |
| 255 |
.BR \-a ", " \-\-atblanks |
| 256 |
When doing soft line wrapping, wrap lines at whitespace |
| 257 |
instead of always at the edge of the screen. |
| 258 |
.TP |
| 259 |
.BR \-b ", " \-\-breaklonglines |
| 260 |
Automatically hard-wrap the current line when it becomes overlong, |
| 261 |
that is: when it becomes wider than the value given with \fB\-r\fR |
| 262 |
(\fB\-\-fill\fR). The default value for \fB-r\fR is the terminal's |
| 263 |
width minus eight. |
| 264 |
(This option is the opposite of \fB\-w\fR (\fB\-\-nowrap\fR) \(em |
| 265 |
the last one given takes effect.) |
| 266 |
.TP |
| 267 |
.BR \-c ", " \-\-constantshow |
| 268 |
Constantly report the cursor position on the status bar. |
| 269 |
Note that this overrides option \fB\-U\fR (\fB\-\-quickblank\fR). |
| 270 |
.TP |
| 271 |
.BR \-d ", " \-\-rebinddelete |
| 272 |
Interpret the Delete and Backspace keys differently so that both Backspace |
| 273 |
and Delete work properly. You should only use this option when on your |
| 274 |
system either Backspace acts like Delete or Delete acts like Backspace. |
| 275 |
.TP |
| 276 |
.BR \-e ", " \-\-emptyline |
| 277 |
Do not use the line below the title bar, leaving it entirely blank. |
| 278 |
.TP |
| 279 |
.BI \-f " file\fR, " \-\-rcfile= file |
| 280 |
Read only this \fIfile\fR for setting nano's options, instead of reading |
| 281 |
both the system-wide and the user's nanorc files. |
| 282 |
.TP |
| 283 |
.BR \-g ", " \-\-showcursor |
| 284 |
Make the cursor visible in the file browser (putting it on the |
| 285 |
highlighted item) and in the help viewer. Useful for braille users |
| 286 |
and people with poor vision. |
| 287 |
.TP |
| 288 |
.BR \-h ", " \-\-help |
| 289 |
Show a summary of the available command-line options and exit. |
| 290 |
.TP |
| 291 |
.BR \-i ", " \-\-autoindent |
| 292 |
Automatically indent a newly created line to the same number of tabs |
| 293 |
and/or spaces as the previous line (or as the next line if the previous |
| 294 |
line is the beginning of a paragraph). |
| 295 |
.TP |
| 296 |
.BR \-j ", " \-\-jumpyscrolling |
| 297 |
Scroll the buffer contents per half-screen instead of per line. |
| 298 |
.TP |
| 299 |
.BR \-k ", " \-\-cutfromcursor |
| 300 |
Make the 'Cut Text' command (normally \fB^K\fR) cut from the current cursor |
| 301 |
position to the end of the line, instead of cutting the entire line. |
| 302 |
.TP |
| 303 |
.BR \-l ", " \-\-linenumbers |
| 304 |
Display line numbers to the left of the text area. |
| 305 |
(Any line with an anchor additionally gets a mark in the margin.) |
| 306 |
.TP |
| 307 |
.BR \-m ", " \-\-mouse |
| 308 |
Enable mouse support, if available for your system. When enabled, mouse |
| 309 |
clicks can be used to place the cursor, set the mark (with a double |
| 310 |
click), and execute shortcuts. The mouse works in the X Window |
| 311 |
System, and on the console when gpm is running. Text can still be |
| 312 |
selected through dragging by holding down the Shift key. |
| 313 |
.TP |
| 314 |
.BR \-n ", " \-\-noread |
| 315 |
Treat any name given on the command line as a new file. This allows |
| 316 |
\fBnano\fR to write to named pipes: it starts with a blank buffer, |
| 317 |
and writes to the pipe when the user saves the "file". This way |
| 318 |
\fBnano\fR can be used as an editor in combination with for instance |
| 319 |
\fBgpg\fR without having to write sensitive data to disk first. |
| 320 |
.TP |
| 321 |
.BI \-o " directory\fR, " \-\-operatingdir= directory |
| 322 |
Change to the given \fIdirectory\fR, and allow reading and writing |
| 323 |
files only in this directory and its subdirectories. |
| 324 |
.TP |
| 325 |
.BR \-p ", " \-\-preserve |
| 326 |
Preserve the XOFF and XON sequences (\fB^S\fR and \fB^Q\fR) so that |
| 327 |
they are caught by the terminal (stopping and resuming the output). |
| 328 |
Note that option \fB\-/\fR (\fB\-\-modernbindings\fR) overrides this. |
| 329 |
.TP |
| 330 |
.BR \-q ", " \-\-indicator |
| 331 |
Display a "scrollbar" on the righthand side of the edit window. |
| 332 |
It shows the position of the viewport in the buffer |
| 333 |
and how much of the buffer is covered by the viewport. |
| 334 |
.TP |
| 335 |
.BI \-r " number\fR, " \-\-fill= number |
| 336 |
Set the target width for justifying and automatic hard-wrapping at this |
| 337 |
\fInumber\fR of columns. If the value is 0 or less, wrapping occurs |
| 338 |
at the width of the screen minus \fInumber\fR columns, allowing the wrap |
| 339 |
point to vary along with the width of the screen if the screen is resized. |
| 340 |
The default value is \fB\-8\fR. |
| 341 |
.TP |
| 342 |
.B "\-s ""\fIprogram\fR [\fIargument \fR...]\fB""\fR, \fB\-\-speller=""\fIprogram\fR [\fIargument \fR...]\fB""" |
| 343 |
Use this command to perform spell checking and correcting, instead of |
| 344 |
using the built-in corrector that calls \fBhunspell\fR(1) or \fBspell\fR(1). |
| 345 |
.TP |
| 346 |
.BR \-t ", " \-\-saveonexit |
| 347 |
Save a changed buffer without prompting (when exiting with \fB^X\fR). |
| 348 |
.TP |
| 349 |
.BR \-u ", " \-\-unix |
| 350 |
Save a file by default in Unix format. This overrides nano's |
| 351 |
default behavior of saving a file in the format that it had. |
| 352 |
(This option has no effect when you also use \fB\-\-noconvert\fR.) |
| 353 |
.TP |
| 354 |
.BR \-v ", " \-\-view |
| 355 |
Just view the file and disallow editing: read-only mode. |
| 356 |
This mode allows the user to open also other files for viewing, |
| 357 |
unless \fB\-\-restricted\fR is given too. |
| 358 |
.TP |
| 359 |
.BR \-w ", " \-\-nowrap |
| 360 |
Do not automatically hard-wrap the current line when it becomes overlong. |
| 361 |
This is the default. (This option is the opposite of \fB\-b\fR |
| 362 |
(\fB\-\-breaklonglines\fR) \(em the last one given takes effect.) |
| 363 |
.TP |
| 364 |
.BR \-x ", " \-\-nohelp |
| 365 |
Don't show the two help lines at the bottom of the screen. |
| 366 |
.TP |
| 367 |
.BR \-y ", " \-\-afterends |
| 368 |
Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings. |
| 369 |
.TP |
| 370 |
.BR \-z ", " \-\-listsyntaxes |
| 371 |
List the names of the available syntaxes and exit. |
| 372 |
.TP |
| 373 |
.BR \-! ", " \-\-magic |
| 374 |
When neither the file's name nor its first line give a clue, |
| 375 |
try using libmagic to determine the applicable syntax. |
| 376 |
.TP |
| 377 |
.BR \-@ ", " \-\-colonparsing |
| 378 |
When a filename given on the command line ends in a colon plus digits |
| 379 |
and this filename does not exist, then snip the colon plus digits and |
| 380 |
understand the digits as a line number. If the trimmed filename does |
| 381 |
not exist either, then repeat the process and understand the obtained |
| 382 |
two numbers as line and column number. But if the doubly trimmed |
| 383 |
filename does not exist either, then forget the trimming and accept |
| 384 |
the original filename as is. To disable this colon parsing for some |
| 385 |
file, use \fB+1\fR or similar before the relevant filename. |
| 386 |
.TP |
| 387 |
.BR \-% ", " \-\-stateflags |
| 388 |
Use the top-right corner of the screen for showing some state flags: |
| 389 |
\fBI\fR when auto-indenting, \fBM\fR when the mark is on, \fBL\fR when |
| 390 |
hard-wrapping (breaking long lines), \fBR\fR when recording a macro, |
| 391 |
and \fBS\fR when soft-wrapping. |
| 392 |
When the buffer is modified, a star (\fB*\fR) is shown after the |
| 393 |
filename in the center of the title bar. |
| 394 |
.TP |
| 395 |
.BR \-_ ", " \-\-minibar |
| 396 |
Suppress the title bar and instead show information about |
| 397 |
the current buffer at the bottom of the screen, in the space |
| 398 |
for the status bar. In this "mini bar" the filename is shown |
| 399 |
on the left, followed by an asterisk if the buffer has been modified. |
| 400 |
On the right are displayed the current line and column number, the |
| 401 |
code of the character under the cursor (in Unicode format: U+xxxx), |
| 402 |
the same flags as are shown by \fB\-\-stateflags\fR, and a percentage |
| 403 |
that expresses how far the cursor is into the file (linewise). |
| 404 |
When a file is loaded or saved, and also when switching between buffers, |
| 405 |
the number of lines in the buffer is displayed after the filename. |
| 406 |
This number is cleared upon the next keystroke, or replaced with an |
| 407 |
[i/n] counter when multiple buffers are open. |
| 408 |
The line plus column numbers and the character code are displayed only when |
| 409 |
\fB\-\-constantshow\fR is used, and can be toggled on and off with \fBM\-C\fR. |
| 410 |
The state flags are displayed only when \fB\-\-stateflags\fR is used. |
| 411 |
.TP |
| 412 |
.BR \-0 ", " \-\-zero |
| 413 |
Hide all elements of the interface (title bar, status bar, and help lines) |
| 414 |
and use all rows of the terminal for showing the contents of the buffer. |
| 415 |
The status bar appears only when there is a significant message, |
| 416 |
and disappears after 1.5 seconds or upon the next keystroke. |
| 417 |
With \fBM\-Z\fR the title bar plus status bar can be toggled. |
| 418 |
With \fBM\-X\fR the help lines. |
| 419 |
.TP |
| 420 |
.BR \-1 ", " \-\-solosidescroll |
| 421 |
When the cursor approaches the right edge of the edit window, scroll only the |
| 422 |
current line sideways by a large amount, instead of scrolling all visible lines |
| 423 |
sideways by just the amount needed to keep the cursor in view. |
| 424 |
This latter whole-window smooth sideways scrolling is the new default behavior. |
| 425 |
The single-line jerky sideways scrolling enabled by this option was the old |
| 426 |
behavior \(em the only behavior that \fBnano\fR knew. |
| 427 |
.TP |
| 428 |
.BR \-/ ", " \-\-modernbindings |
| 429 |
Use key bindings similar to the ones that most modern programs use: |
| 430 |
\fB^X\fR cuts, \fB^C\fR copies, \fB^V\fR pastes, |
| 431 |
\fB^Z\fR undoes, \fB^Y\fR redoes, |
| 432 |
\fB^F\fR searches forward, \fB^G\fR searches next, |
| 433 |
\fB^S\fR saves, \fB^O\fR opens a file, \fB^Q\fR quits, |
| 434 |
and (when the terminal permits) \fB^H\fR shows help. |
| 435 |
Furthermore, \fB^A\fR sets the mark, \fB^B\fR searches backward, |
| 436 |
\fB^D\fR searches previous, \fB^R\fR makes replacements, |
| 437 |
\fB^P\fR shows the position, \fB^T\fR goes to a line, |
| 438 |
\fB^W\fR writes out a file, and \fB^E\fR executes a command. |
| 439 |
Note that this option overrides option \fB\-p\fR (\fB\-\-preserve\fR). |
| 440 |
|
| 441 |
.SH TOGGLES |
| 442 |
Several of the above options can be switched on and off also while |
| 443 |
\fBnano\fR is running. For example, \fBM\-L\fR toggles the |
| 444 |
hard-wrapping of long lines, \fBM\-S\fR toggles soft-wrapping, |
| 445 |
\fBM\-N\fR toggles line numbers, \fBM\-M\fR toggles the mouse, |
| 446 |
\fBM\-I\fR auto-indentation, and \fBM\-X\fR the help lines. |
| 447 |
See at the end of the \fB^G\fR help text for a complete list. |
| 448 |
.sp |
| 449 |
The \fBM\-X\fR toggle is special: it works in all menus except |
| 450 |
the help viewer and the linter. All other toggles work in |
| 451 |
the main menu only. |
| 452 |
|
| 453 |
.SH FILES |
| 454 |
When \fB\-\-rcfile\fR is given, \fBnano\fR reads just the specified file |
| 455 |
for setting its options and syntaxes and key bindings. Without that |
| 456 |
option, \fBnano\fR reads two configuration files: first the system's |
| 457 |
\fInanorc\fR (if it exists), and then the user's \fInanorc\fR (if it |
| 458 |
exists), either \fI~/.nanorc\fR or \fI$XDG_CONFIG_HOME/nano/nanorc\fR |
| 459 |
or \fI~/.config/nano/nanorc\fR, whichever is encountered first. See |
| 460 |
.BR nanorc (5) |
| 461 |
for more information on the possible contents of those files. |
| 462 |
.sp |
| 463 |
See \fI/usr/share/nano/\fR and \fI/usr/share/nano/extra/\fR |
| 464 |
for available syntax-coloring definitions. |
| 465 |
|
| 466 |
.SH EXIT STATUS |
| 467 |
.TP |
| 468 |
.B 0 |
| 469 |
The editor finished normally. |
| 470 |
.TP |
| 471 |
.B 1 |
| 472 |
An invalid option or option argument was given. |
| 473 |
.TP |
| 474 |
.B 2 |
| 475 |
The last open buffer was discarded (with \fB^O^Q\fR or \fB^X^Q\fR). |
| 476 |
|
| 477 |
.SH NOTES |
| 478 |
Suspension is enabled by default, reachable via \fB^T^Z\fR. |
| 479 |
(If you want a plain \fB^Z\fR to suspend nano, add |
| 480 |
\fBbind ^Z suspend main\fR to your nanorc.) |
| 481 |
.sp |
| 482 |
At a Yes-No prompt, \fB^Y\fR can be used for "Yes", \fB^N\fR for "No", |
| 483 |
and \fB^A\fR for "All". |
| 484 |
(And when exiting, \fB^Q\fR can be used for "Quit with error".) |
| 485 |
These unlisted bindings work in any locale. |
| 486 |
.sp |
| 487 |
When you want to copy marked text from \fBnano\fR to the system's clipboard, |
| 488 |
see one of the examples in the \fBnanorc\fR(5) man page. |
| 489 |
.sp |
| 490 |
If no alternative spell checker command is specified on the command |
| 491 |
line nor in one of the \fInanorc\fR files, \fBnano\fR checks the |
| 492 |
\fBSPELL\fR environment variable for one. |
| 493 |
.sp |
| 494 |
In some cases \fBnano\fR tries to dump the buffer into an emergency file. |
| 495 |
This happens mainly if \fBnano\fR receives a SIGHUP or SIGTERM or runs out |
| 496 |
of memory. It writes the buffer into a file named \fInano.save\fR if the |
| 497 |
buffer didn't have a name already, or adds a ".save" suffix to the current |
| 498 |
filename. If an emergency file with that name already exists in the |
| 499 |
current directory, it adds ".save" plus a number (e.g.\& ".save.1") to |
| 500 |
the current filename in order to make it unique. In multibuffer mode, |
| 501 |
\fBnano\fR writes all open buffers to their respective emergency files. |
| 502 |
.sp |
| 503 |
If you have any question about how to use \fBnano\fR in some specific |
| 504 |
situation, you can ask on \fIhelp\[email protected]\fR. |
| 505 |
|
| 506 |
.SH BUGS |
| 507 |
The recording and playback of keyboard macros works correctly only on a |
| 508 |
terminal emulator, not on a Linux console (VT), because the latter does |
| 509 |
not by default distinguish modified from unmodified arrow keys. |
| 510 |
.sp |
| 511 |
Please report any other bugs that you encounter via: |
| 512 |
.br |
| 513 |
.IR https://savannah.gnu.org/bugs/?group=nano . |
| 514 |
.sp |
| 515 |
When nano crashes, it saves any modified buffers to emergency .save files. |
| 516 |
If you are able to reproduce the crash and you want to get a backtrace, define |
| 517 |
the environment variable \fBNANO_NOCATCH\fR. |
| 518 |
|
| 519 |
.SH HOMEPAGE |
| 520 |
.I https://nano\-editor.org/ |
| 521 |
|
| 522 |
.SH SEE ALSO |
| 523 |
.BR nanorc (5) |
| 524 |
.sp |
| 525 |
\fI/usr/share/doc/nano/\fR (or equivalent on your system) |