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