Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 1 | \input texinfo @c -*-texinfo-*- |
| 2 | @c %**start of header |
| 3 | @setfilename nano.info |
| 4 | @settitle nano Command Manual |
| 5 | @c %**end of header |
| 6 | |
| 7 | @c This file has the new style title page commands. |
| 8 | @c Run `makeinfo' rather than `texinfo-format-buffer'. |
| 9 | @smallbook |
| 10 | @set EDITION 0.1 |
Chris Allegretta | a4a222d | 2001-02-20 03:52:13 +0000 | [diff] [blame] | 11 | @set VERSION 0.9.99pre3 |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 12 | @set UPDATED 12 Feb 2001 |
| 13 | |
| 14 | |
| 15 | @c tex |
| 16 | @c \overfullrule=0pt |
| 17 | @c end tex |
| 18 | |
| 19 | @titlepage |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 20 | @title GNU @code{nano} |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 21 | @subtitle a small and friendly text editor. |
Chris Allegretta | a4a222d | 2001-02-20 03:52:13 +0000 | [diff] [blame] | 22 | @subtitle version 0.9.99pre3 |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 23 | |
| 24 | @author Chris Allegretta |
| 25 | @page |
| 26 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 27 | This manual documents GNU @code{nano}, a small and friendly text |
| 28 | editor. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 29 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 30 | This manual is part of the GNU @code{nano} distribution.@* |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 31 | @sp4 |
| 32 | Copyright (C) 1999, 2000, 2001 Chris Allegretta. |
| 33 | |
| 34 | Permission is granted to make and distribute verbatim copies of |
| 35 | this manual provided the copyright notice and this permission notice |
| 36 | are preserved on all copies. |
| 37 | |
| 38 | @iftex |
| 39 | Permission is granted to process this file through TeX and print the |
| 40 | results, provided the printed document carries copying permission |
| 41 | notice identical to this one except for the removal of this paragraph |
| 42 | (this paragraph not being relevant to the printed manual). |
| 43 | @end iftex |
| 44 | |
| 45 | Permission is granted to copy and distribute modified versions of this |
| 46 | manual under the conditions for verbatim copying, provided that the entire |
| 47 | resulting derived work is distributed under the terms of a permission |
| 48 | notice identical to this one. |
| 49 | |
| 50 | Permission is granted to copy and distribute translations of this manual |
| 51 | into another language, under the above conditions for modified versions, |
| 52 | except that this permission notice may be stated in a translation approved |
| 53 | by the Foundation. |
| 54 | |
| 55 | You may contact the author by: |
| 56 | e-mail: @email{chrisa@@asty.org}@* |
| 57 | @end titlepage |
| 58 | |
| 59 | @node Top, Introduction, (dir), (dir) |
| 60 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 61 | This manual documents GNU nano, a small and friendly text editor. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 62 | |
| 63 | @menu |
| 64 | * Introduction:: |
| 65 | * Editor Basics:: |
| 66 | * Online Help:: |
| 67 | * Feature Toggles:: |
| 68 | * The File Browser:: |
| 69 | * Pico Compatibility:: |
| 70 | * Building and Configure Options:: |
| 71 | @end menu |
| 72 | |
| 73 | @node Introduction, Editor Basics, Top, Top |
| 74 | @chapter Introduction |
| 75 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 76 | GNU @code{nano} is a small and friendly text editor. Besides basic |
| 77 | text editing, @code{nano} offers many extra features like an |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 78 | interactive search and replace, goto line number, auto-indentation, |
| 79 | feature toggles, internationalization support, and filename tab |
| 80 | completion. |
| 81 | |
| 82 | @menu |
| 83 | * Overview:: |
| 84 | * Command Line Options:: |
| 85 | @end menu |
| 86 | |
| 87 | @node Overview, Command Line Options, Introduction, Introduction |
| 88 | @section Overview |
| 89 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 90 | @code{nano} [GNU long option] [option] +LINE [ @var{ file ...} ] |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 91 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 92 | The original goal for @code{nano} was a complete bug-for-bug compatible |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 93 | emulation of Pico, but consistency is now a slightly higher priority. |
| 94 | There is a flag to implement (nearly) complete Pico emulation, (option -p |
| 95 | or GNU long option --pico). This can also be toggled from within |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 96 | @code{nano} by typing Meta-P. @xref{Pico Compatibility}, for more |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 97 | info. |
| 98 | |
| 99 | Email bug reports to @email{nano@@nano-editor.org}. |
| 100 | |
| 101 | @node Command Line Options, , Overview, Introduction |
| 102 | @section Command Line Options |
| 103 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 104 | @code{nano} takes the following options from the command line: |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 105 | @table @code |
| 106 | |
| 107 | @item -T [num, --tabsize=[num] |
| 108 | Set the displayed tab length to [num] columns. |
| 109 | |
| 110 | @item -R, --regexp |
| 111 | Turns on regular expression search and search/replace. |
| 112 | |
| 113 | @item -V, --version |
| 114 | Print the version number and copyright and quit. |
| 115 | |
| 116 | @item -c, --const |
| 117 | Constantly display the cursor posititon and line number on the statusbar. |
| 118 | |
| 119 | @item -h, --help |
| 120 | Print the usage and exit. |
| 121 | |
| 122 | @item -i, --autoindent |
| 123 | Automatically indent new lines to the same number of spaces and tabs as |
| 124 | the previous line. |
| 125 | |
| 126 | @item -k, --cut |
| 127 | Makes ^K cut from the current cursor position to the end of the current |
| 128 | line. |
| 129 | |
| 130 | @item -l, --nofollow |
| 131 | When writing files, if the given file is a symbolic link it is removed |
| 132 | and a new file is created. |
| 133 | |
| 134 | @item -m, --mouse |
| 135 | Enables the use of the mouse to select text (currently only useful for |
| 136 | running under the X window system). |
| 137 | |
| 138 | @item -p, --pico |
| 139 | Emulate Pico as closely as possible, sacrificing consistency for correct |
| 140 | emulation. @xref{Pico Compatibility}, for more info. |
| 141 | |
| 142 | @item -r [#cols], --fill=[#cols]. |
| 143 | Wrap lines at column #cols. By default this is the width of the screen, |
| 144 | less eight. |
| 145 | |
| 146 | @item -s [prog], --speller=[prog] |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 147 | Invoke [prog] as the spell checker. By default, @code{nano} uses its |
| 148 | own interactive spell checker that requires the @code{spell} program be |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 149 | installed on your system. |
| 150 | |
| 151 | @item -t, --tempfile |
| 152 | Do not ask whether or not to save the current contents of the file when |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 153 | exiting, assume yes. This is most useful when using @code{nano} as the |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 154 | composer of a mailer program. |
| 155 | |
| 156 | @anchor{Expert Mode} |
| 157 | @item -x, --nohelp |
| 158 | In Expert Mode, the Shortcut Lists will not appear at the bottom of the |
| 159 | screen. This affects the location of the statusbar as well, as in Expert |
| 160 | Mode it is located at the very bottom of the editor. |
| 161 | |
| 162 | Note: When accesing the help system, Expert Mode is temporarily disabled |
| 163 | to display the help system navigation keys. |
| 164 | |
| 165 | @item -v, --view |
| 166 | Do not allow the contents of the file to be altered. Note that this |
| 167 | flag should NOT be used in place of correct file permissions to implement |
| 168 | a read-only file. |
| 169 | |
| 170 | @item -w, --nowrap |
| 171 | Do not wrap long lines at any length. This option overrides any value for |
| 172 | -r. |
| 173 | |
| 174 | @item -z, --suspend |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 175 | Enable suspend ability of @code{nano} using the system's suspend |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 176 | keystroke (usually ^Z). |
| 177 | |
| 178 | @item +LINE |
| 179 | Start at line number LINE instead of the default of line 1. |
| 180 | @end table |
| 181 | |
| 182 | @node Editor Basics, Online Help, Introduction, Top |
| 183 | @chapter Editor Basics |
| 184 | @menu |
| 185 | * Entering Text:: |
| 186 | * Special Functions:: |
| 187 | * The Titlebar:: |
| 188 | * The Statusbar:: |
| 189 | * Shortcut Lists:: |
| 190 | @end menu |
| 191 | |
| 192 | @node Entering Text, Special Functions, Editor Basics, Editor Basics |
| 193 | @section Entering Text |
| 194 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 195 | All key sequences in @code{nano} are entered using the keyboard. |
| 196 | @code{nano} is a "modeless" editor, all keys with the exception of |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 197 | Control and Meta key sequences will enter text into the file being |
| 198 | edited. |
| 199 | |
| 200 | @node Special Functions, The Titlebar, Entering Text, Editor Basics |
| 201 | @section Special Functions |
| 202 | |
| 203 | Special functions use the Control key (displayed in the help and |
| 204 | shotcut lists as ^) or the Meta key (displayed as M). |
| 205 | |
| 206 | @itemize @bullet |
| 207 | |
| 208 | @item |
| 209 | Control key sequences are entered by holding down the Control key and |
| 210 | pressing the desired letter. |
| 211 | @item |
| 212 | Meta key sequences can be entered in a number of |
| 213 | possible ways: Pressing the Escape key, then releasing it and pressing |
| 214 | the desired key, or holding down the Alt key while pressing the desired |
| 215 | key. This varies from keyboard to keyboard, and certain commercial |
| 216 | operating systems "swallow" the Alt key so that it never reaches the |
| 217 | application. If your operating system does this, you should use the |
| 218 | Escape key to generate Meta key sequences. |
| 219 | @end itemize |
| 220 | |
| 221 | @node The Titlebar, The Statusbar, Special Functions, Editor Basics |
| 222 | @section The Titlebar |
| 223 | |
| 224 | The titlebar is the line displayed at the top of the editor. There are |
| 225 | three sections: left, center and right. The section on the left displays |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 226 | the version of @code{nano} being used. The center section displays the |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 227 | current file name, or "New Buffer" if the file has not yet been named. |
| 228 | The section on the right will display "Modified" if the file has been |
| 229 | modified since it ws last saved or opened. |
| 230 | |
| 231 | Special modes: When nano is in "File browser" mode, the center section |
| 232 | will display the current directory instead of the filename. |
| 233 | @xref{The File Browser}. |
| 234 | |
| 235 | @node The Statusbar, Shortcut Lists, The Titlebar, Editor Basics |
| 236 | @section The Statusbar |
| 237 | |
| 238 | The statusbar is located three lines from the bottom of the screen (or the |
| 239 | bottom line in Expert Mode. @xref{Expert Mode}, for more info. |
| 240 | |
| 241 | The Statusbar shows important and informational messages. Any error |
| 242 | messages that occur from using the editor will appear on the statusbar. |
| 243 | Any questions that are asked of the user will be asked on the statusbar, |
| 244 | and any user input (serch strings, file names, etc) will be input on the |
| 245 | statusbar. |
| 246 | |
| 247 | @node Shortcut Lists, , The Statusbar, Editor Basics |
| 248 | @section Shortcut Lists |
| 249 | |
| 250 | The Shorcut Lists are the two lines at the bottom of the screen which show |
| 251 | some of the more commonly used functions in the editor. The exact |
| 252 | functions which are displayed depend on whether Pico Compatibility Mode mode |
| 253 | is enabled. @xref{Pico Compatibility}, for more info. |
| 254 | |
| 255 | @node Online Help, Feature Toggles, Editor Basics, Top |
| 256 | @chapter Online Help |
| 257 | |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 258 | The online help system in @code{nano} is available by pressing ^G. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 259 | It is fairly self explanatory, documenting the various parts of the |
| 260 | editor and available keystrokes. Navigation is via the ^Y (Page Up) |
| 261 | and ^V (Page Down) keys. ^X exits the help system. |
| 262 | |
| 263 | |
| 264 | @node Feature Toggles, The File Browser, Online Help, Top |
| 265 | @chapter Feature Toggles |
| 266 | |
| 267 | Toggles allow you to change certain aspects of the editor that |
| 268 | would normally be done via command line flags. They are invoked via |
| 269 | certain Meta key sequenced. @xref{Special Functions}, for more info. |
| 270 | The following toggles are available: |
| 271 | |
| 272 | @table @code |
| 273 | |
| 274 | @item Constant Update Toggle (Meta-C) |
| 275 | toggles the -c (--const) command line flag. |
| 276 | |
| 277 | @item Regular Expressions Toggle (Meta-E) |
| 278 | toggles the -R (--regexp) command line flag. |
| 279 | |
| 280 | @item AutoIndent Toggle (Meta-I) |
| 281 | toggles the -i (--autoindent) command line flag. |
| 282 | |
| 283 | @item Cut To End Toggle (Meta-K) |
| 284 | toggles the -k (--cut) command line flag. |
| 285 | |
| 286 | @item Cut To End Toggle (Meta-M) |
| 287 | toggles the -m (--mouse) command line flag. |
| 288 | |
| 289 | @item Pico Mode Toggle (Meta-P) |
| 290 | toggles the -p (--pico) command line flag. |
| 291 | @xref{Pico Compatibility}, for more info. |
| 292 | |
| 293 | @item AutoWrap Toggle (Meta-W) |
| 294 | toggles the -w (--nowrap) command line flag. |
| 295 | |
| 296 | @item Expert/Nohelp Toggle (Meta-X) |
| 297 | toggles the -x (--nohelp) command line flag. |
| 298 | |
| 299 | @item Suspend Toggle (Meta-Z) |
Chris Allegretta | 203ce15 | 2001-02-23 03:05:38 +0000 | [diff] [blame] | 300 | toggles the -z (--suspend) command line flag. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 301 | |
| 302 | @end table |
| 303 | |
| 304 | @node The File Browser, Pico Compatibility, Feature Toggles, Top |
| 305 | @chapter The File Browser |
| 306 | |
| 307 | When reading or writilg files, pressing ^T will invoke the file browser. |
| 308 | Here, one can navigate directories in a graphical manner in order to find |
| 309 | the desired file. |
| 310 | |
| 311 | Basic movement in the file browser is accomplished with he arrow keys |
| 312 | and page up/down. The behavior of the enter (or 's') key varies by what |
| 313 | is currently selected. If the currently selected object is a directory, |
| 314 | the file browser will enter and display the contects of the directory. If |
| 315 | the object is a file, this filename and path are copied to the statusbar |
| 316 | and the file browser is exited. |
| 317 | |
| 318 | @node Pico Compatibility, Building and Configure Options, The File Browser, Top |
| 319 | @chapter Pico Compatibility |
| 320 | |
| 321 | Nano does not completely emulate Pico by default. The following differences |
| 322 | apply to the default mode and Pico Compatibility mode: |
| 323 | |
| 324 | @table @code |
| 325 | @item Displayed Shortcuts |
Chris Allegretta | 882e145 | 2001-02-12 06:52:50 +0000 | [diff] [blame] | 326 | By default, the following shortcuts are displayed in the Shortcut Lists: |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 327 | |
| 328 | ^G ^O ^\ ^Y ^K ^C@* |
| 329 | ^X ^R ^W ^V ^U ^T |
| 330 | |
| 331 | Related functions are listed above or below each other by default. The |
Chris Allegretta | fb9cffe | 2001-02-12 06:42:43 +0000 | [diff] [blame] | 332 | Justify function is not listed, instead the "Replace" function is |
Chris Allegretta | 882e145 | 2001-02-12 06:52:50 +0000 | [diff] [blame] | 333 | displayed. Also, he "Read File" and "WriteOut" functions are aligned for |
Chris Allegretta | fb9cffe | 2001-02-12 06:42:43 +0000 | [diff] [blame] | 334 | consistency. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 335 | |
| 336 | In Pico Compatibility mode, the default Pico shortcuts are displayed: |
| 337 | |
| 338 | ^G ^O ^R ^Y ^K ^C@* |
| 339 | ^X ^J ^W ^V ^U ^T |
| 340 | |
| 341 | @item Previous String Text |
| 342 | By default, previously entered string for a function (search string, |
| 343 | file name) will be placed on the statusbar, and is editable. This is |
| 344 | done so there is consistency across all functions. For example: even if |
Chris Allegretta | 882e145 | 2001-02-12 06:52:50 +0000 | [diff] [blame] | 345 | there is a previous replace string, it can always be deleted if one |
| 346 | wishes to perform an empty string replace. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 347 | |
| 348 | In Pico Compatibility Mode, the previously entered text in a search or |
| 349 | replace will appear in brackets, and is not editable. It is not a |
| 350 | simple matter to do an empty string replace when a previous replace |
| 351 | string exists, for example. When writing a file, the previous filename |
| 352 | will be displayed in the editable text portion of the editor. |
| 353 | |
| 354 | @item Interactive Replace and Spell Checker |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 355 | It is worth noting that the @code{nano} replace function is interactive, |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 356 | i.e. it does not stop after one search string is found and automatically |
Chris Allegretta | 35ac99d | 2001-02-15 00:25:17 +0000 | [diff] [blame] | 357 | replace it. The @code{nano} implementation will stop at each search |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 358 | string found and query whether to replace this instance or not. The |
| 359 | internal spell checker operates similarly. Note that these is no way |
Chris Allegretta | 882e145 | 2001-02-12 06:52:50 +0000 | [diff] [blame] | 360 | to force these functions to behave in the Pico fashion. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 361 | @end table |
| 362 | |
| 363 | @node Building and Configure Options, , Pico Compatibility, Top |
| 364 | @chapter Building and Configure Options |
| 365 | |
| 366 | Building nano from source is fairly straightforward if you are familiar |
| 367 | with compiling programs with autoconf support: |
| 368 | |
| 369 | tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano) |
| 370 | cd nano-x.y.z/ |
| 371 | ./configure |
| 372 | make |
| 373 | make install |
| 374 | |
| 375 | if you are looking to optimize nano for size, you may want to consider |
| 376 | the following command line options: |
| 377 | |
| 378 | |
| 379 | @table @code |
| 380 | |
| 381 | @item --disable-tabcomp |
| 382 | Disable the tab completion code when reading or writing files. |
| 383 | |
| 384 | @item --disable-justify |
| 385 | Disable the justify (^J)/unjustify (^U) functions in the editor. |
| 386 | |
| 387 | @item --disable-speller |
| 388 | Disables spell checker abillity. |
| 389 | |
| 390 | @item --disable-help |
| 391 | Disables the help function (^G). Disabling this option maks the |
| 392 | binary much smaller, but makes it difficult for new users |
| 393 | to learn more than very basic things about using the editor. |
| 394 | |
| 395 | @item --disable-browser |
| 396 | Disables the mini file browser (^O) when reading or writing files. |
| 397 | |
| 398 | @item --enable-tiny |
| 399 | This options disables all the above. It also disables some of |
| 400 | the larger internals of the editor, like the marker code (^^) and |
Chris Allegretta | 203ce15 | 2001-02-23 03:05:38 +0000 | [diff] [blame] | 401 | the cut to line (-k) option which it depends on to work properly. |
Chris Allegretta | 7e7bcf8 | 2001-02-12 03:48:53 +0000 | [diff] [blame] | 402 | It also disables the function toggles and mouse support. |
| 403 | @end table |
| 404 | |
| 405 | @contents |
| 406 | @bye |
| 407 | |
| 408 | |