nano.texi 15.1 KB
Newer Older
Chris Allegretta's avatar
Chris Allegretta committed
1
2
3
4
5
6
7
8
9
10
\input texinfo  @c -*-texinfo-*-
@c %**start of header
@setfilename nano.info
@settitle nano Command Manual
@c %**end of header

@c This file has the new style title page commands.
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
11
12
@set VERSION 1.1.2
@set UPDATED 3 Oct 2001
Chris Allegretta's avatar
Chris Allegretta committed
13

14
15
16
17
@dircategory Editors
@direntry
* Nano: (nano).                 Small and friendly text editor.
@end direntry
Chris Allegretta's avatar
Chris Allegretta committed
18
19
20
21
22
23

@c tex
@c \overfullrule=0pt
@c end tex

@titlepage
24
@title GNU @code{nano}
Chris Allegretta's avatar
Chris Allegretta committed
25
@subtitle a small and friendly text editor.
26
@subtitle version 1.1.2
Chris Allegretta's avatar
Chris Allegretta committed
27
28
29
30

@author Chris Allegretta
@page

31
32
This manual documents GNU @code{nano}, a small and friendly text
editor.
Chris Allegretta's avatar
Chris Allegretta committed
33

34
This manual is part of the GNU @code{nano} distribution.@*
Chris Allegretta's avatar
Chris Allegretta committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@sp4
Copyright (C) 1999, 2000, 2001 Chris Allegretta.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@iftex
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end iftex

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.

You may contact the author by:
e-mail: @email{chrisa@@asty.org}@*
@end titlepage

@node Top, Introduction, (dir), (dir)

65
This manual documents GNU nano, a small and friendly text editor.
Chris Allegretta's avatar
Chris Allegretta committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79

@menu
* Introduction::
* Editor Basics::
* Online Help::
* Feature Toggles::
* The File Browser::
* Pico Compatibility::
* Building and Configure Options::
@end menu

@node Introduction, Editor Basics, Top, Top
@chapter Introduction

80
81
GNU @code{nano} is a small and friendly text editor.  Besides basic
text editing, @code{nano} offers many extra features like an
Chris Allegretta's avatar
Chris Allegretta committed
82
83
84
85
86
87
88
89
90
91
92
93
interactive search and replace, goto line number, auto-indentation,
feature toggles, internationalization support, and filename tab
completion.

@menu
* Overview::
* Command Line Options::
@end menu

@node Overview, Command Line Options, Introduction, Introduction
@section Overview

94
@code{nano} [GNU long option] [option] +LINE [ @var{ file ...} ]
Chris Allegretta's avatar
Chris Allegretta committed
95

96
The original goal for @code{nano} was a complete bug-for-bug compatible
Chris Allegretta's avatar
Chris Allegretta committed
97
98
99
emulation of Pico, but consistency is now a slightly higher priority.
There is a flag to implement (nearly) complete Pico emulation, (option -p
or GNU long option --pico).  This can also be toggled from within
100
@code{nano} by typing Meta-P.  @xref{Pico Compatibility}, for more
Chris Allegretta's avatar
Chris Allegretta committed
101
102
103
104
105
106
107
info.

Email bug reports to @email{nano@@nano-editor.org}. 

@node Command Line Options, , Overview, Introduction
@section Command Line Options

108
@code{nano} takes the following options from the command line:
Chris Allegretta's avatar
Chris Allegretta committed
109
110
@table @code

111
112
113
114
115
116
117
118
@item -D, --dos
Write file in DOS format.

@item -F, --multibuffer
Enable multiple file buffers.

@item -M, --mac
Write file in Mac format.
Chris Allegretta's avatar
Chris Allegretta committed
119
120
121
122

@item -R, --regexp
Turns on regular expression search and search/replace.

123
124
125
126
127
128
@item -S, --smooth
Enables smooth scrolling.

@item -T [num], --tabsize=[num]
Set the displayed tab length to [num] columns.

Chris Allegretta's avatar
Chris Allegretta committed
129
130
131
132
@item -V, --version 
Print the version number and copyright and quit.

@item -c, --const
133
Constantly display the cursor position and line number on the statusbar.
Chris Allegretta's avatar
Chris Allegretta committed
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

@item -h, --help
Print the usage and exit.

@item -i, --autoindent
Automatically indent new lines to the same number of spaces and tabs as
the previous line.

@item -k, --cut
Makes ^K cut from the current cursor position to the end of the current
line.

@item -l, --nofollow
When writing files, if the given file is a symbolic link it is removed
and a new file is created.

@item -m, --mouse
Enables the use of the mouse to select text (currently only useful for
running under the X window system).

154
155
156
@item -o [dir], --operatingdir=[dir]
Set operating directory. Makes nano set up something similar to a chroot. 

Chris Allegretta's avatar
Chris Allegretta committed
157
158
159
160
161
162
@item -p, --pico
Emulate Pico as closely as possible, sacrificing consistency for correct
emulation.  @xref{Pico Compatibility}, for more info.

@item -r [#cols], --fill=[#cols].
Wrap lines at column #cols.  By default this is the width of the screen,
163
164
165
less eight. If this value is negative, wrapping will occur at #cols from
the right of the screen, allowing it to vary along with the screen width
if the screen is resized.
Chris Allegretta's avatar
Chris Allegretta committed
166
167

@item -s [prog], --speller=[prog]
168
169
Invoke [prog] as the spell checker.  By default, @code{nano} uses its
own interactive spell checker that requires the @code{spell} program be
Chris Allegretta's avatar
Chris Allegretta committed
170
171
172
173
installed on your system.

@item -t, --tempfile
Do not ask whether or not to save the current contents of the file when
174
exiting, assume yes.  This is most useful when using @code{nano} as the
Chris Allegretta's avatar
Chris Allegretta committed
175
176
177
178
179
180
181
182
composer of a mailer program.

@anchor{Expert Mode}
@item -x, --nohelp
In Expert Mode, the Shortcut Lists will not appear at the bottom of the 
screen.  This affects the location of the statusbar as well, as in Expert
Mode it is located at the very bottom of the editor.

183
Note: When accessing the help system, Expert Mode is temporarily disabled
Chris Allegretta's avatar
Chris Allegretta committed
184
185
186
187
188
189
190
191
192
193
194
195
to display the help system navigation keys.

@item -v, --view
Do not allow the contents of the file to be altered.  Note that this
flag should NOT be used in place of correct file permissions to implement
a read-only file.

@item -w, --nowrap
Do not wrap long lines at any length. This option overrides any value for
-r.

@item -z, --suspend
196
Enable suspend ability of @code{nano} using the system's suspend
Chris Allegretta's avatar
Chris Allegretta committed
197
198
keystroke (usually ^Z).

199
200
201
@item -b, -e, -f
Ignored, for compatibility with Pico.

Chris Allegretta's avatar
Chris Allegretta committed
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
@item +LINE
Start at line number LINE instead of the default of line 1.
@end table

@node Editor Basics, Online Help, Introduction, Top
@chapter Editor Basics
@menu
* Entering Text::
* Special Functions::
* The Titlebar::
* The Statusbar::
* Shortcut Lists::
@end menu

@node Entering Text, Special Functions, Editor Basics, Editor Basics
@section Entering Text

219
220
All key sequences in @code{nano} are entered using the keyboard.
@code{nano} is a "modeless" editor, all keys with the exception of
Chris Allegretta's avatar
Chris Allegretta committed
221
222
223
224
225
226
227
Control and Meta key sequences will enter text into the file being
edited.  

@node Special Functions, The Titlebar, Entering Text, Editor Basics
@section Special Functions

Special functions use the Control key (displayed in the help and
228
shortcut lists as ^) or the Meta key (displayed as M).
Chris Allegretta's avatar
Chris Allegretta committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
     
@itemize @bullet
     
@item
Control key sequences are entered by holding down the Control key and
pressing the desired letter.  
@item
Meta key sequences can be entered in a number of
possible ways: Pressing the Escape key, then releasing it and pressing
the desired key, or holding down the Alt key while pressing the desired 
key.  This varies from keyboard to keyboard, and certain commercial
operating systems "swallow" the Alt key so that it never reaches the
application. If your operating system does this, you should use the
Escape key to generate Meta key sequences.
@end itemize

@node The Titlebar, The Statusbar, Special Functions, Editor Basics
@section The Titlebar

The titlebar is the line displayed at the top of the editor.  There are
three sections: left, center and right. The section on the left displays
250
the version of @code{nano} being used.  The center section displays the
Chris Allegretta's avatar
Chris Allegretta committed
251
252
current file name, or "New Buffer" if the file has not yet been named.
The section on the right will display "Modified" if the file has been
253
modified since it was last saved or opened.
Chris Allegretta's avatar
Chris Allegretta committed
254
255
256
257
258
259
260
261
262
263
264
265
266
267

Special modes: When nano is in "File browser" mode, the center section
will display the current directory instead of the filename. 
@xref{The File Browser}.

@node The Statusbar, Shortcut Lists, The Titlebar, Editor Basics
@section The Statusbar

The statusbar is located three lines from the bottom of the screen (or the
bottom line in Expert Mode.  @xref{Expert Mode}, for more info.  

The Statusbar shows important and informational messages.  Any error
messages that occur from using the editor will appear on the statusbar.
Any questions that are asked of the user will be asked on the statusbar,
268
and any user input (search strings, file names, etc) will be input on the
Chris Allegretta's avatar
Chris Allegretta committed
269
270
271
272
273
statusbar.

@node Shortcut Lists, , The Statusbar, Editor Basics
@section Shortcut Lists

274
The Shortcut Lists are the two lines at the bottom of the screen which show
Chris Allegretta's avatar
Chris Allegretta committed
275
276
277
278
279
280
281
some of the more commonly used functions in the editor. The exact
functions which are displayed depend on whether Pico Compatibility Mode mode
is enabled. @xref{Pico Compatibility}, for more info.

@node Online Help, Feature Toggles, Editor Basics, Top
@chapter Online Help

282
The online help system in @code{nano} is available by pressing ^G.
Chris Allegretta's avatar
Chris Allegretta committed
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
It is fairly self explanatory, documenting the various parts of the 
editor and available keystrokes.  Navigation is via the ^Y (Page Up)
and ^V (Page Down) keys.  ^X exits the help system.


@node Feature Toggles, The File Browser, Online Help, Top
@chapter Feature Toggles

Toggles allow you to change certain aspects of the editor that
would normally be done via command line flags. They are invoked via
certain Meta key sequenced. @xref{Special Functions}, for more info.
The following toggles are available:

@table @code

298
299
300
301
302
303
@item Case Sensitive Search Toggle (Meta-A)
toggles case sensistive searching functionality on/off.

@item Backwards Search Toggle (Meta-B)
toggles backwards searching fuctionality on/off.

Chris Allegretta's avatar
Chris Allegretta committed
304
305
306
@item Constant Update Toggle (Meta-C)
toggles the -c (--const) command line flag.

307
308
309
@item DOS Format Toggle (Meta-D)
toggles the -D (--dos) command line flag.

Chris Allegretta's avatar
Chris Allegretta committed
310
311
312
@item Regular Expressions Toggle (Meta-E)
toggles the -R (--regexp) command line flag.

313
314
315
@item Multiple Files Toggle (Meta-F)
toggles the  -F (--multibuffer) command line flag.

Chris Allegretta's avatar
Chris Allegretta committed
316
317
318
319
320
321
@item AutoIndent Toggle (Meta-I)
toggles the -i (--autoindent) command line flag.

@item Cut To End Toggle (Meta-K)
toggles the -k (--cut) command line flag.

322
@item Mouse Toggle (Meta-M)
Chris Allegretta's avatar
Chris Allegretta committed
323
324
toggles the -m (--mouse) command line flag.

325
326
327
@item Mac Format Toggle (Meta-O)
toggles the -M (--mac) command line flag.

Chris Allegretta's avatar
Chris Allegretta committed
328
329
330
331
@item Pico Mode Toggle (Meta-P)
toggles the -p (--pico) command line flag.
@xref{Pico Compatibility}, for more info.

332
333
334
@item Smooth Scrolling Toggle (Meta-S)
toggles the -s (--smooth) command line flag.

Chris Allegretta's avatar
Chris Allegretta committed
335
336
337
338
339
340
341
@item AutoWrap Toggle (Meta-W)
toggles the -w (--nowrap) command line flag.

@item Expert/Nohelp Toggle (Meta-X)
toggles the -x (--nohelp) command line flag.

@item Suspend Toggle (Meta-Z)
342
toggles the -z (--suspend) command line flag.
Chris Allegretta's avatar
Chris Allegretta committed
343

344
345
346
347
348
349
350
@item Open Previous File Toggle (Meta-<)
changes buffer to previously loaded file.

@item Open Next File Toggle (Meta->)
changes buffer to next loaded file.


Chris Allegretta's avatar
Chris Allegretta committed
351
352
353
354
355
@end table

@node The File Browser, Pico Compatibility, Feature Toggles, Top
@chapter The File Browser

356
When reading or writing files, pressing ^T will invoke the file browser.
Chris Allegretta's avatar
Chris Allegretta committed
357
358
359
360
361
362
Here, one can navigate directories in a graphical manner in order to find
the desired file.

Basic movement in the file browser is accomplished with he arrow keys
and page up/down.  The behavior of the enter (or 's') key varies by what 
is currently selected.  If the currently selected object is a directory, 
363
the file browser will enter and display the contents of the directory.  If
Chris Allegretta's avatar
Chris Allegretta committed
364
365
366
367
368
369
370
371
372
373
374
the object is a file, this filename and path are copied to the statusbar
and the file browser is exited.

@node Pico Compatibility, Building and Configure Options, The File Browser, Top
@chapter Pico Compatibility

Nano does not completely emulate Pico by default.  The following differences
apply to the default mode and Pico Compatibility mode:

@table @code
@item Displayed Shortcuts
Chris Allegretta's avatar
Chris Allegretta committed
375
By default, the following shortcuts are displayed in the Shortcut Lists:
Chris Allegretta's avatar
Chris Allegretta committed
376
377
378
379
380

^G ^O ^\ ^Y ^K ^C@*
^X ^R ^W ^V ^U ^T

Related functions are listed above or below each other by default.  The
Chris Allegretta's avatar
Chris Allegretta committed
381
Justify function is not listed, instead the "Replace" function is
Chris Allegretta's avatar
Chris Allegretta committed
382
displayed. Also, he "Read File" and "WriteOut" functions are aligned for
Chris Allegretta's avatar
Chris Allegretta committed
383
consistency.
Chris Allegretta's avatar
Chris Allegretta committed
384
385
386
387
388
389
390
391
392
393

In Pico Compatibility mode, the default Pico shortcuts are displayed:

^G ^O ^R ^Y ^K ^C@*
^X ^J ^W ^V ^U ^T   

@item Previous String Text
By default, previously entered string for a function (search string,
file name) will be placed on the statusbar, and is editable.  This is
done so there is consistency across all functions.  For example: even if
Chris Allegretta's avatar
Chris Allegretta committed
394
395
there is a previous replace string, it can always be deleted if one
wishes to perform an empty string replace.
Chris Allegretta's avatar
Chris Allegretta committed
396
397
398
399
400
401
402
403

In Pico Compatibility Mode, the previously entered text in a search or
replace will appear in brackets, and is not editable.  It is not a
simple matter to do an empty string replace when a previous replace
string exists, for example.  When writing a file, the previous filename
will be displayed in the editable text portion of the editor.

@item Interactive Replace and Spell Checker
404
It is worth noting that the @code{nano} replace function is interactive,
Chris Allegretta's avatar
Chris Allegretta committed
405
i.e. it does not stop after one search string is found and automatically 
406
replace it.  The @code{nano} implementation will stop at each search
Chris Allegretta's avatar
Chris Allegretta committed
407
408
string found and query whether to replace this instance or not.  The 
internal spell checker operates similarly.  Note that these is no way 
Chris Allegretta's avatar
Chris Allegretta committed
409
to force these functions to behave in the Pico fashion.
Chris Allegretta's avatar
Chris Allegretta committed
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
@end table

@node Building and Configure Options, , Pico Compatibility, Top
@chapter Building and Configure Options

Building nano from source is fairly straightforward if you are familiar
with compiling programs with autoconf support:

tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
cd nano-x.y.z/
./configure
make
make install

if you are looking to optimize nano for size, you may want to consider
the following command line options:


@table @code

@item --disable-tabcomp
Disable the tab completion code when reading or writing files.

@item --disable-justify
Disable the justify (^J)/unjustify (^U) functions in the editor.

@item --disable-speller
437
Disables spell checker ability.
Chris Allegretta's avatar
Chris Allegretta committed
438
439

@item --disable-help
440
Disables the help function (^G).  Disabling this option makes the
Chris Allegretta's avatar
Chris Allegretta committed
441
442
443
444
445
446
447
448
449
binary much smaller, but makes it difficult for new users
to learn more than very basic things about using the editor.

@item --disable-browser
Disables the mini file browser (^O) when reading or writing files.

@item --enable-tiny
This options disables all the above.  It also disables some of
the larger internals of the editor, like the marker code (^^) and
450
the cut to line (-k) option which it depends on to work properly.
Chris Allegretta's avatar
Chris Allegretta committed
451
It also disables the function toggles and mouse support.
452
453
454
455
456

@item --disable-wrapping
Disables all word wrapping in the editor.  This also eliminates the 
-w command line flag, as nonwrapping is then the default behavior.

457
458
459
460
@item --disable-mouse
Disables all mouse functionality.  This also disables the -m commands line 
flag which enables the mouse functions.

461
462
463
464
465
466
467
468
469
470
471
472
@item --disable-operatingdir
Disables setting of operating directory. This also disables the -o command
line flag.

@item --disable-nls
Disables Native Language support. This will make the available GNU nano
translations unusable.

@item --with-slang
Compiling GNU nano with Slang is supported, and will make the binary notably
smaller than if compiled with ncurses or other curses libraries.

Chris Allegretta's avatar
Chris Allegretta committed
473
474
475
476
477
478
@end table

@contents
@bye