blob: 1daba64bbdba861149fc79d224ef272197318f41 [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 Allegretta38068cd2001-04-06 20:04:23 +000011@set VERSION 1.0.1
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000012@set UPDATED 12 Feb 2001
13
Chris Allegretta7ab3e8f2001-03-22 23:12:22 +000014@dircategory Editors
15@direntry
16* Nano: (nano). Small and friendly text editor.
17@end direntry
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000018
19@c tex
20@c \overfullrule=0pt
21@c end tex
22
23@titlepage
Chris Allegretta35ac99d2001-02-15 00:25:17 +000024@title GNU @code{nano}
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000025@subtitle a small and friendly text editor.
Chris Allegretta38068cd2001-04-06 20:04:23 +000026@subtitle version 1.0.1
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000027
28@author Chris Allegretta
29@page
30
Chris Allegretta35ac99d2001-02-15 00:25:17 +000031This manual documents GNU @code{nano}, a small and friendly text
32editor.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000033
Chris Allegretta35ac99d2001-02-15 00:25:17 +000034This manual is part of the GNU @code{nano} distribution.@*
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000035@sp4
36Copyright (C) 1999, 2000, 2001 Chris Allegretta.
37
38Permission is granted to make and distribute verbatim copies of
39this manual provided the copyright notice and this permission notice
40are preserved on all copies.
41
42@iftex
43Permission is granted to process this file through TeX and print the
44results, provided the printed document carries copying permission
45notice identical to this one except for the removal of this paragraph
46(this paragraph not being relevant to the printed manual).
47@end iftex
48
49Permission is granted to copy and distribute modified versions of this
50manual under the conditions for verbatim copying, provided that the entire
51resulting derived work is distributed under the terms of a permission
52notice identical to this one.
53
54Permission is granted to copy and distribute translations of this manual
55into another language, under the above conditions for modified versions,
56except that this permission notice may be stated in a translation approved
57by the Foundation.
58
59You may contact the author by:
60e-mail: @email{chrisa@@asty.org}@*
61@end titlepage
62
63@node Top, Introduction, (dir), (dir)
64
Chris Allegretta35ac99d2001-02-15 00:25:17 +000065This manual documents GNU nano, a small and friendly text editor.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000066
67@menu
68* Introduction::
69* Editor Basics::
70* Online Help::
71* Feature Toggles::
72* The File Browser::
73* Pico Compatibility::
74* Building and Configure Options::
75@end menu
76
77@node Introduction, Editor Basics, Top, Top
78@chapter Introduction
79
Chris Allegretta35ac99d2001-02-15 00:25:17 +000080GNU @code{nano} is a small and friendly text editor. Besides basic
81text editing, @code{nano} offers many extra features like an
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000082interactive search and replace, goto line number, auto-indentation,
83feature toggles, internationalization support, and filename tab
84completion.
85
86@menu
87* Overview::
88* Command Line Options::
89@end menu
90
91@node Overview, Command Line Options, Introduction, Introduction
92@section Overview
93
Chris Allegretta35ac99d2001-02-15 00:25:17 +000094@code{nano} [GNU long option] [option] +LINE [ @var{ file ...} ]
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000095
Chris Allegretta35ac99d2001-02-15 00:25:17 +000096The original goal for @code{nano} was a complete bug-for-bug compatible
Chris Allegretta7e7bcf82001-02-12 03:48:53 +000097emulation of Pico, but consistency is now a slightly higher priority.
98There is a flag to implement (nearly) complete Pico emulation, (option -p
99or GNU long option --pico). This can also be toggled from within
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000100@code{nano} by typing Meta-P. @xref{Pico Compatibility}, for more
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000101info.
102
103Email bug reports to @email{nano@@nano-editor.org}.
104
105@node Command Line Options, , Overview, Introduction
106@section Command Line Options
107
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000108@code{nano} takes the following options from the command line:
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000109@table @code
110
111@item -T [num, --tabsize=[num]
112Set the displayed tab length to [num] columns.
113
114@item -R, --regexp
115Turns on regular expression search and search/replace.
116
117@item -V, --version
118Print the version number and copyright and quit.
119
120@item -c, --const
Chris Allegretta88520c92001-05-05 17:45:54 +0000121Constantly display the cursor position and line number on the statusbar.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000122
123@item -h, --help
124Print the usage and exit.
125
126@item -i, --autoindent
127Automatically indent new lines to the same number of spaces and tabs as
128the previous line.
129
130@item -k, --cut
131Makes ^K cut from the current cursor position to the end of the current
132line.
133
134@item -l, --nofollow
135When writing files, if the given file is a symbolic link it is removed
136and a new file is created.
137
138@item -m, --mouse
139Enables the use of the mouse to select text (currently only useful for
140running under the X window system).
141
142@item -p, --pico
143Emulate Pico as closely as possible, sacrificing consistency for correct
144emulation. @xref{Pico Compatibility}, for more info.
145
146@item -r [#cols], --fill=[#cols].
147Wrap lines at column #cols. By default this is the width of the screen,
Chris Allegretta6fe61492001-05-21 12:56:25 +0000148less eight. If this value is negative, wrapping will occur at #cols from
149the right of the screen, allowing it to vary along with the screen width
150if the screen is resized.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000151
152@item -s [prog], --speller=[prog]
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000153Invoke [prog] as the spell checker. By default, @code{nano} uses its
154own interactive spell checker that requires the @code{spell} program be
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000155installed on your system.
156
157@item -t, --tempfile
158Do not ask whether or not to save the current contents of the file when
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000159exiting, assume yes. This is most useful when using @code{nano} as the
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000160composer of a mailer program.
161
162@anchor{Expert Mode}
163@item -x, --nohelp
164In Expert Mode, the Shortcut Lists will not appear at the bottom of the
165screen. This affects the location of the statusbar as well, as in Expert
166Mode it is located at the very bottom of the editor.
167
Chris Allegretta88520c92001-05-05 17:45:54 +0000168Note: When accessing the help system, Expert Mode is temporarily disabled
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000169to display the help system navigation keys.
170
171@item -v, --view
172Do not allow the contents of the file to be altered. Note that this
173flag should NOT be used in place of correct file permissions to implement
174a read-only file.
175
176@item -w, --nowrap
177Do not wrap long lines at any length. This option overrides any value for
178-r.
179
180@item -z, --suspend
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000181Enable suspend ability of @code{nano} using the system's suspend
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000182keystroke (usually ^Z).
183
184@item +LINE
185Start at line number LINE instead of the default of line 1.
186@end table
187
188@node Editor Basics, Online Help, Introduction, Top
189@chapter Editor Basics
190@menu
191* Entering Text::
192* Special Functions::
193* The Titlebar::
194* The Statusbar::
195* Shortcut Lists::
196@end menu
197
198@node Entering Text, Special Functions, Editor Basics, Editor Basics
199@section Entering Text
200
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000201All key sequences in @code{nano} are entered using the keyboard.
202@code{nano} is a "modeless" editor, all keys with the exception of
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000203Control and Meta key sequences will enter text into the file being
204edited.
205
206@node Special Functions, The Titlebar, Entering Text, Editor Basics
207@section Special Functions
208
209Special functions use the Control key (displayed in the help and
Chris Allegretta88520c92001-05-05 17:45:54 +0000210shortcut lists as ^) or the Meta key (displayed as M).
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000211
212@itemize @bullet
213
214@item
215Control key sequences are entered by holding down the Control key and
216pressing the desired letter.
217@item
218Meta key sequences can be entered in a number of
219possible ways: Pressing the Escape key, then releasing it and pressing
220the desired key, or holding down the Alt key while pressing the desired
221key. This varies from keyboard to keyboard, and certain commercial
222operating systems "swallow" the Alt key so that it never reaches the
223application. If your operating system does this, you should use the
224Escape key to generate Meta key sequences.
225@end itemize
226
227@node The Titlebar, The Statusbar, Special Functions, Editor Basics
228@section The Titlebar
229
230The titlebar is the line displayed at the top of the editor. There are
231three sections: left, center and right. The section on the left displays
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000232the version of @code{nano} being used. The center section displays the
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000233current file name, or "New Buffer" if the file has not yet been named.
234The section on the right will display "Modified" if the file has been
Chris Allegretta88520c92001-05-05 17:45:54 +0000235modified since it was last saved or opened.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000236
237Special modes: When nano is in "File browser" mode, the center section
238will display the current directory instead of the filename.
239@xref{The File Browser}.
240
241@node The Statusbar, Shortcut Lists, The Titlebar, Editor Basics
242@section The Statusbar
243
244The statusbar is located three lines from the bottom of the screen (or the
245bottom line in Expert Mode. @xref{Expert Mode}, for more info.
246
247The Statusbar shows important and informational messages. Any error
248messages that occur from using the editor will appear on the statusbar.
249Any questions that are asked of the user will be asked on the statusbar,
Chris Allegretta88520c92001-05-05 17:45:54 +0000250and any user input (search strings, file names, etc) will be input on the
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000251statusbar.
252
253@node Shortcut Lists, , The Statusbar, Editor Basics
254@section Shortcut Lists
255
Chris Allegretta88520c92001-05-05 17:45:54 +0000256The Shortcut Lists are the two lines at the bottom of the screen which show
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000257some of the more commonly used functions in the editor. The exact
258functions which are displayed depend on whether Pico Compatibility Mode mode
259is enabled. @xref{Pico Compatibility}, for more info.
260
261@node Online Help, Feature Toggles, Editor Basics, Top
262@chapter Online Help
263
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000264The online help system in @code{nano} is available by pressing ^G.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000265It is fairly self explanatory, documenting the various parts of the
266editor and available keystrokes. Navigation is via the ^Y (Page Up)
267and ^V (Page Down) keys. ^X exits the help system.
268
269
270@node Feature Toggles, The File Browser, Online Help, Top
271@chapter Feature Toggles
272
273Toggles allow you to change certain aspects of the editor that
274would normally be done via command line flags. They are invoked via
275certain Meta key sequenced. @xref{Special Functions}, for more info.
276The following toggles are available:
277
278@table @code
279
280@item Constant Update Toggle (Meta-C)
281toggles the -c (--const) command line flag.
282
283@item Regular Expressions Toggle (Meta-E)
284toggles the -R (--regexp) command line flag.
285
286@item AutoIndent Toggle (Meta-I)
287toggles the -i (--autoindent) command line flag.
288
289@item Cut To End Toggle (Meta-K)
290toggles the -k (--cut) command line flag.
291
292@item Cut To End Toggle (Meta-M)
293toggles the -m (--mouse) command line flag.
294
295@item Pico Mode Toggle (Meta-P)
296toggles the -p (--pico) command line flag.
297@xref{Pico Compatibility}, for more info.
298
299@item AutoWrap Toggle (Meta-W)
300toggles the -w (--nowrap) command line flag.
301
302@item Expert/Nohelp Toggle (Meta-X)
303toggles the -x (--nohelp) command line flag.
304
305@item Suspend Toggle (Meta-Z)
Chris Allegretta203ce152001-02-23 03:05:38 +0000306toggles the -z (--suspend) command line flag.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000307
308@end table
309
310@node The File Browser, Pico Compatibility, Feature Toggles, Top
311@chapter The File Browser
312
Chris Allegretta88520c92001-05-05 17:45:54 +0000313When reading or writing files, pressing ^T will invoke the file browser.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000314Here, one can navigate directories in a graphical manner in order to find
315the desired file.
316
317Basic movement in the file browser is accomplished with he arrow keys
318and page up/down. The behavior of the enter (or 's') key varies by what
319is currently selected. If the currently selected object is a directory,
Chris Allegretta88520c92001-05-05 17:45:54 +0000320the file browser will enter and display the contents of the directory. If
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000321the object is a file, this filename and path are copied to the statusbar
322and the file browser is exited.
323
324@node Pico Compatibility, Building and Configure Options, The File Browser, Top
325@chapter Pico Compatibility
326
327Nano does not completely emulate Pico by default. The following differences
328apply to the default mode and Pico Compatibility mode:
329
330@table @code
331@item Displayed Shortcuts
Chris Allegretta882e1452001-02-12 06:52:50 +0000332By default, the following shortcuts are displayed in the Shortcut Lists:
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000333
334^G ^O ^\ ^Y ^K ^C@*
335^X ^R ^W ^V ^U ^T
336
337Related functions are listed above or below each other by default. The
Chris Allegrettafb9cffe2001-02-12 06:42:43 +0000338Justify function is not listed, instead the "Replace" function is
Chris Allegretta882e1452001-02-12 06:52:50 +0000339displayed. Also, he "Read File" and "WriteOut" functions are aligned for
Chris Allegrettafb9cffe2001-02-12 06:42:43 +0000340consistency.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000341
342In Pico Compatibility mode, the default Pico shortcuts are displayed:
343
344^G ^O ^R ^Y ^K ^C@*
345^X ^J ^W ^V ^U ^T
346
347@item Previous String Text
348By default, previously entered string for a function (search string,
349file name) will be placed on the statusbar, and is editable. This is
350done so there is consistency across all functions. For example: even if
Chris Allegretta882e1452001-02-12 06:52:50 +0000351there is a previous replace string, it can always be deleted if one
352wishes to perform an empty string replace.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000353
354In Pico Compatibility Mode, the previously entered text in a search or
355replace will appear in brackets, and is not editable. It is not a
356simple matter to do an empty string replace when a previous replace
357string exists, for example. When writing a file, the previous filename
358will be displayed in the editable text portion of the editor.
359
360@item Interactive Replace and Spell Checker
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000361It is worth noting that the @code{nano} replace function is interactive,
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000362i.e. it does not stop after one search string is found and automatically
Chris Allegretta35ac99d2001-02-15 00:25:17 +0000363replace it. The @code{nano} implementation will stop at each search
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000364string found and query whether to replace this instance or not. The
365internal spell checker operates similarly. Note that these is no way
Chris Allegretta882e1452001-02-12 06:52:50 +0000366to force these functions to behave in the Pico fashion.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000367@end table
368
369@node Building and Configure Options, , Pico Compatibility, Top
370@chapter Building and Configure Options
371
372Building nano from source is fairly straightforward if you are familiar
373with compiling programs with autoconf support:
374
375tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
376cd nano-x.y.z/
377./configure
378make
379make install
380
381if you are looking to optimize nano for size, you may want to consider
382the following command line options:
383
384
385@table @code
386
387@item --disable-tabcomp
388Disable the tab completion code when reading or writing files.
389
390@item --disable-justify
391Disable the justify (^J)/unjustify (^U) functions in the editor.
392
393@item --disable-speller
Chris Allegretta88520c92001-05-05 17:45:54 +0000394Disables spell checker ability.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000395
396@item --disable-help
Chris Allegretta88520c92001-05-05 17:45:54 +0000397Disables the help function (^G). Disabling this option makes the
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000398binary much smaller, but makes it difficult for new users
399to learn more than very basic things about using the editor.
400
401@item --disable-browser
402Disables the mini file browser (^O) when reading or writing files.
403
404@item --enable-tiny
405This options disables all the above. It also disables some of
406the larger internals of the editor, like the marker code (^^) and
Chris Allegretta203ce152001-02-23 03:05:38 +0000407the cut to line (-k) option which it depends on to work properly.
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000408It also disables the function toggles and mouse support.
Chris Allegrettacef7fbb2001-04-02 05:36:08 +0000409
410@item --disable-wrapping
411Disables all word wrapping in the editor. This also eliminates the
412-w command line flag, as nonwrapping is then the default behavior.
413
Chris Allegretta84de5522001-04-12 14:51:48 +0000414@item --disable-mouse
415Disables all mouse functionality. This also disables the -m commands line
416flag which enables the mouse functions.
417
Chris Allegretta7e7bcf82001-02-12 03:48:53 +0000418@end table
419
420@contents
421@bye
422
423