Import ee 1.5.2
[dragonfly.git] / contrib / ee / ee.1
1 .\"
2 .\"
3 .\"  To format this reference page, use the command:
4 .\"
5 .\"    nroff -man ee.1
6 .\"
7 .\"  $Header: /home/hugh/sources/old_ae/RCS/ee.1,v 1.22 2001/12/16 04:49:27 hugh Exp $
8 .\"
9 .\"
10 .TH ee 1 "" "" "" ""
11 .SH NAME
12 ee \- easy editor
13 .SH SYNOPSIS
14 .nf
15 ee [-e] [-i] [-h] [+#] [\fIfile\fR ...]
16 ree [-e] [-i] [-h] [+#] [\fIfile\fR ...]
17 .ta
18 .fi
19 .ad b
20 .SH DESCRIPTION
21 The command 
22 .I ee 
23 is a simple screen oriented text editor.  It is always in text insertion 
24 mode unless there is a prompt at the bottom of the terminal, or a 
25 menu present (in a box in the middle of the terminal).  The command 
26 .I ree 
27 is the same as 
28 .I ee, 
29 but restricted to editing the named 
30 file (no file operations, or shell escapes are allowed).
31 .PP
32 An editor with similar user-friendly qualities but more features is available 
33 and is called 
34 .I aee.
35 .PP
36 For 
37 .I ee
38 to work properly, the environment variable 
39 .SM TERM 
40 must be set to indicate the type of terminal being used.  For 
41 example, for an 
42 .SM HP 700/92 
43 terminal, the 
44 .SM TERM 
45 variable should be set to "70092".  See your System Administrator if 
46 you need more information.
47 .\"
48 .\"     options
49 .\"
50 .SS Options
51 The following options are available from the command line:
52 .PP
53 .TP 4
54 .B -e
55 Turns off expansion of tab character to spaces.
56 .TP 
57 .B -i
58 Turns off display of information window at top of terminal.
59 .TP
60 .B -h
61 Turns off highlighting of borders of windows and menus (improves 
62 performance on some terminals).
63 .TP
64 .B +#
65 Moves the cursor to line '#' at startup.
66 .br
67 .\"
68 .\"     control keys
69 .\"
70 .SS "Control keys"
71 To do anything other than insert text, the user must use the control 
72 keys (the 
73 .B Control 
74 key, represented by a "^",  pressed in conjunction with an 
75 alphabetic key, e.g., ^a) and function keys available on the keyboard 
76 (such as 
77 .BR "Next Page" ", " "Prev Page" ,
78 arrow keys, etc.).
79 .PP
80 Since not all terminals have function keys, 
81 .I ee
82 has the basic cursor movement functions assigned to control keys as 
83 well as more intuitive keys on the keyboard when available.  For 
84 instance, to move the cursor up, the user can use the up arrow key, 
85 or 
86 .BR ^u .
87 .RS 4
88 .nf
89 .ta 1.4i
90 .sp
91 ^a      Prompt for the decimal value of a character to insert.
92 ^b      Move to the bottom of the text.
93 ^c      Get the prompt for a command.
94 ^d      Move the cursor down.
95 ^e      Prompt for the string to search for.
96 ^f      Undelete the last deleted character.
97 ^g      Move to the beginning of the line.
98 ^h      Backspace.
99 ^i      Tab.
100 ^j      Insert a newline.
101 ^k      Delete the character the cursor is sitting on.
102 ^l      Move the cursor left.
103 ^m      Insert a newline.
104 ^n      Move to the next page.
105 ^o      Move to the end of the line.
106 ^p      Move to the previous page.
107 ^r      Move the cursor to the right.
108 ^t      Move to the top of the text.
109 ^u      Move the cursor up.
110 ^v      Undelete the last deleted word.
111 ^w      Delete the word beginning at the cursor position.
112 ^x      Search.
113 ^y      Delete from the cursor position to the end of line.
114 ^z      Undelete the last deleted line.
115 ^[ (ESC)        Pop up menu.
116 .ta
117 .fi
118 .RE
119 .sp
120 .SS "EMACS keys mode"
121 .PP
122 Since many shells provide an Emacs mode (for cursor movement and other editing 
123 operations), some bindings that may be more useful for people familiar with 
124 those bindings have been provided.  These are accessible via the 
125 .B settings 
126 menu, or via the initialization file (see below).  The mappings are as follows:
127 .RS
128 .nf
129 .ta 1.4i
130 ^a      Move to the beginning of the line.
131 ^b      Back 1 character.
132 ^c      Command prompt.
133 ^d      Delete character the cursor is sitting on.
134 ^e      End of line.
135 ^f      Forward 1 character.
136 ^g      Go back 1 page.
137 ^h      Backspace.
138 ^i      Tab.
139 ^j      Undelete last deleted character.
140 ^k      Delete line.
141 ^l      Undelete last deleted line.
142 ^m      Insert a newline.
143 ^n      Move to the next line.
144 ^o      Prompt for the decimal value of a character to insert.
145 ^p      Previous line.
146 ^r      Restore last deleted word.
147 ^t      Move to the top of the text.
148 ^u      Move to the bottom of the text.
149 ^v      Move to the next page.
150 ^w      Delete the word beginning at the cursor position.
151 ^y      Prompt for the string to search for.
152 ^z      Next word.
153 ^[ (ESC)        Pop up menu.
154 .ta
155 .fi
156 .RE
157 .sp
158 .\"
159 .\"     function keys
160 .\"
161 .SS "Function Keys"
162 .RS 4
163 .IP "\fBNext Page\fR"
164 Move to the next page.
165 .IP "\fBPrev Page\fR"
166 Move to the previous page.
167 .IP "\fBDelete Char\fR"
168 Delete the character the cursor is on.
169 .IP "\fBDelete Line\fR"
170 Delete from the cursor to the end of line.
171 .IP "\fBInsert line\fR"
172 Insert a newline at the cursor position.
173 .IP "\fBArrow keys\fR"
174 Move the cursor in the direction indicated.
175 .RE
176 .\"
177 .\"     commands
178 .\"
179 .SS Commands
180 .PP
181 Some operations require more information than a single keystroke can 
182 provide.  For the most basic operations, there is a menu that can be 
183 obtained by pressing the 
184 .SM \fBESC\fR
185 key.  The same operations, and more can be performed by obtaining the 
186 command prompt (^c) and typing in one of the commands below.
187 .RS 4
188 .IP "!\fBcmd\fR"
189 Execute \fBcmd\fR in a shell.
190 .IP "\fB0-9\fR"
191 Move to the line indicated.
192 .IP "\fBcase\fR"
193 Make searches case sensitive.
194 .IP "\fBcharacter\fR"
195 Display the ascii value of the character at the cursor.
196 .IP "\fBexit\fR"
197 Save the edited text, and leave the editor.
198 .IP "\fBexpand\fR"
199 Expand tabs to spaces.
200 .IP "\fBfile\fR"
201 Print the name of the file.
202 .IP "\fBhelp\fR"
203 Display help screen.
204 .IP "\fBline\fR"
205 Display the current line number.
206 .IP "\fBnocase\fR
207 Make searches insensitive to case (the default).
208 .IP "\fBnoexpand\fR"
209 Don't expand tab to spaces when the TAB key is pressed.
210 .IP "\fBquit\fR"
211 Leave the editor without saving changes.
212 .IP "\fBread\fR \fIfile\fR"
213 Read the named \fIfile\fR.
214 .IP "\fBwrite\fR \fIfile\fR"
215 Write the text to the named \fIfile\fR.
216 .RE
217 .\"
218 .\"     menu operations
219 .\"
220 .SS "Menu Operations"
221 .PP
222 Pop-up menus can be obtained by pressing the 
223 .B escape 
224 key (or 
225 .B ^[ 
226 if no 
227 .B escape 
228 key is present).  When in the menu, the escape key can be 
229 used to leave the menu without performing any operations.  Use the up and 
230 down arrow keys, or 
231 .B ^u
232 for moving up and 
233 .B ^d 
234 for moving down to move to the desired items in the menu, then press 
235 .B return 
236 to perform the indicated task.
237 .PP
238 To the left of each menu item is a letter, which if the corresponding 
239 letter is pressed on the keyboard selects that menu entry.
240 .PP
241 The main menu in \fIee\fR is as follows:
242 .RS 4
243 .IP "\fBleave editor\fR" 
244 If changes have been made, the user will get a menu prompting whether or 
245 not the changes should be saved.
246 .IP "\fBhelp\fR"
247 Displays a help screen, with all of the keyboard operations and commands.
248 .IP "\fBfile operations\fR"
249 Pops up a menu for selecting whether to read a file, write to a file, or 
250 save the current contents of the editor, as well as send the contents of 
251 the editor to a print command (see the section \fBInitializing ee from a 
252 file\fR).
253 .IP "\fBredraw screen\fR"
254 Provides a means to repaint the screen if the screen has been corrupted.
255 .IP "\fBsettings\fR"
256 Shows the current values of the operating modes, and right margin.  By 
257 pressing return when the cursor is on a particular item, the value can be 
258 changed.  To leave this menu, press the \fBescape\fR key.  (See \fBModes\fR 
259 below.)
260 .IP "\fBsearch\fR"
261 .br
262 Pops up a menu in which the user may choose to enter a string to search 
263 for, or search for a string already entered.
264 .IP "\fBmiscellaneous\fR"
265 Pops up a menu that allows the user to format the current paragraph, 
266 execute a shell command, or check the spelling of the text in the editor.
267 .RE
268 .\"
269 .\"     paragraph formatting
270 .\"
271 .SS "Paragraph Formatting"
272 .PP
273 Paragraphs are defined for \fIee\fR by a block of text bounded by:
274 .sp 
275 .RS 8
276 .IP \(bu 
277 Begin or end of file.
278 .IP \(bu
279 Line with no characters, or only spaces and/or tabs.
280 .IP \(bu
281 Line starting with a period ('.') or right angle bracket ('>').
282 .RE
283 .PP
284 A paragraph may be formatted two ways:  explicitly by choosing the 
285 \fBformat paragraph\fR menu item, or by setting \fIee\fR to automatically 
286 format paragraphs.  The automatic mode may be set via a menu, or via the 
287 initialization file.
288 .PP
289 There are three states for text operation in \fIee\fR: free-form, margins, 
290 and automatic formatting.
291 .PP
292 "Free-form" is best used for things like programming.  There are no 
293 restrictions on the length of lines, and no formatting takes place.
294 .PP
295 "Margins" allows the user to type in text without having to worry about going 
296 beyond the right margin (the right margin may be set in the \fBsettings\fR 
297 menu, the default is for the margin to be the right edge of the 
298 terminal).  This is the mode that allows the \fBformat paragraph\fR menu 
299 item to work.
300 .PP
301 "Automatic formatting" provides word-processor-like behavior.  The user 
302 may type in text, while \fIee\fR will make sure the entire paragraph fits 
303 within the width of the terminal every time the user inserts a space after 
304 typing or deleting text.  Margin observation must also be enabled in order for 
305 automatic formatting to occur.
306 .\"
307 .\"     modes
308 .\"
309 .SS Modes
310 .PP
311 Although ee is a 'modeless' editor (it is in text insertion mode all the 
312 time), there are modes in some of the things it does.  These include:
313 .RS 4
314 .IP "\fBtab expansion\fR"
315 Tabs may be inserted as a single tab character, or replaced with spaces.
316 .IP "\fBcase sensitivity\fR"
317 The search operation can be sensitive to whether characters are upper- or 
318 lower-case, or ignore case completely.
319 .IP "\fBmargins observed\fR"
320 Lines can either be truncated at the right margin, or extend on forever.
321 .IP "\fBauto paragraph formatting\fR"
322 While typing in text, the editor can try to keep it looking reasonably well 
323 within the width of the screen.
324 .IP "\fBeightbit characters\fR"
325 Toggles whether eight bit characters are displayed as their value in angle 
326 brackets (e.g. "<220>") or as a character.
327 .IP "\fBinfo window\fR"
328 A window showing the keyboard operations that can be performed can be 
329 displayed or not.
330 .IP "\fBemacs keys\fR"
331 Control keys may be given bindings similar to emacs, or not.
332 .IP "\f16 bit characters\fR"
333 Toggles whether sixteen bit characters are handled as one 16-bit quantities or 
334 two 8-bit quantities.  This works primarily with the Chinese Big 5 code set.
335 .RE
336 .PP
337 You may set these modes via the initialization file (see below), or with a 
338 menu (see above).
339 .\"
340 .\"     spell checking
341 .\"
342 .SS "Spell Checking"
343 .PP
344 There are two ways to have the spelling in the text checked from \fIee\fR.  
345 One is by the traditional \fIspell\fR(1) command, the other is with the 
346 optional \fIispell\fR(1) command.
347 .PP
348 Using \fIspell\fR, the words that are not recognized will be placed at the top 
349 of the file.  For the \fIispell\fR option, the file is written to disk, 
350 then \fIispell\fR run on the file, and the file read back in once 
351 \fIispell\fR has completed making changes to the file.
352 .\"
353 .\"     printing
354 .\"
355 .SS "Printing the contents of the editor"
356 .PP
357 The user may select a menu item which prints the contents of the editor.  
358 .I ee
359 pipes the text in the editor to the command specified by the 
360 initialization command 
361 .B printcommand
362 (see the section 
363 .B Initializing ee from a file 
364 below).  The default is to send the contents to "lp".  
365 .PP
366 Whatever the user assigns to 
367 .B printcommand 
368 must take input from 
369 standard input.  See your system administrator for more details.
370 .\"
371 .\"     shell operations
372 .\"
373 .SS "Shell operations"
374 .PP
375 Shell commands can be executed from within 
376 .I ee 
377 by selecting the 
378 .B shell command 
379 item in the 
380 .B miscellaneous 
381 menu, or by placing an exclamation mark ("!") before the command to 
382 execute at the 
383 .B command: 
384 prompt.  Additionally, the user may direct the contents of the edit buffer 
385 out to a shell operation (via a pipe) by using the left angle bracket 
386 (">"), followed by a "!" and the shell command to execute.  The output of 
387 a shell operation can also be directed into the edit buffer by using a 
388 right angle bracket ("<") before the exclamation mark.  These can even be 
389 used together to send output to a shell operation and read back the 
390 results into the editor.  So, if the editor contained a list of words 
391 to be sorted, they could be sorted by typing the following at the command 
392 prompt:
393 .RS 4
394 .sp
395 ><!sort
396 .sp
397 .RE
398 This would send the contents of the editor to be piped into the 
399 .I sort 
400 utility and the result would be placed into the edit buffer at the current 
401 cursor location.  The old information would have to be deleted by the user.
402 .\"
403 .\"     initializing ee from a file
404 .\"
405 .SS "Initializing ee from a file"
406 .PP
407 Since different users have different preferences, \fIee\fR allows some 
408 slight configurability.  There are three possible locations for an 
409 initialization file for ee:  the file \fI/usr/local/lib/init.ee\fR, the 
410 file \fI.init.ee\fR in the user's home directory, or the file \fI.init.ee\fR 
411 in the current directory (if different from the home 
412 directory).  This allows system administrators to set some preferences for 
413 the users on a system-wide basis (for example, the \fBprint\fR command), 
414 and the user to customize settings for particular directories (like one 
415 for correspondence, and a different directory for programming).
416 .PP
417 The file \fI\/usr/local/lib/init.ee\fR is read first, then 
418 \fI$HOME/.init.ee\fR, then \fI.init.ee\fR, with the settings specified by the 
419 most recent file read taking precedence.
420 .PP
421 The following items may be entered in the initialization file:
422 .RS 4
423 .IP \fBcase\fR
424 Sets searches to be case sensitive.
425 .IP \fBnocase\fR
426 Sets searches to be insensitive to case (default).
427 .IP \fBexpand\fR
428 Causes \fIee\fR to expand tabs to spaces (default).
429 .IP \fBnoexpand\fR 
430 Causes \fIee\fR to insert tabs as a single character.
431 .IP \fBinfo\fR
432 A small information window is displayed at the top of the terminal 
433 (default).
434 .IP \fBnoinfo\fR
435 Turns off the display of the information window.
436 .IP \fBmargins\fR
437 Causes \fIee\fR to truncate lines at the right margin when the 
438 cursor passes beyond the right margin as set by the user 
439 while text is being inserted 
440 (default).
441 .IP \fBnomargins\fR
442 Allows lines to extend beyond the right margin.
443 .IP \fBautoformat\fR
444 Causes \fIee\fR to automatically try to format the current paragraph while 
445 text insertion is occurring.
446 .IP \fBnoautoformat\fR
447 Turns off automatic paragraph formatting (default).
448 .IP \fBprintcommand\fR
449 Allows the setting of the print command (default: "lp").
450 .IP \fBrightmargin\fR
451 The user can select a value for the right margin (the first column on the 
452 screen is zero).
453 .IP \fBhighlight\fR
454 Turns on highlighting border of information window and menus (default).
455 .IP \fBnohighlight\fR
456 Turns off highlighting of border of information window and menus.
457 .IP \fBeightbit\fR
458 Turns on display of eight bit characters.
459 .IP \fBnoeightbit\fR
460 Turns off display of eight bit characters (they are displayed as their decimal 
461 value inside angle brackets, e.g., "<220>").
462 .IP \fB16bit\fR
463 Turns on handling of 16-bit characters.
464 .IP \fbno16bit\fR
465 Turns off handling of 16-bit characters.
466 .IP \fBemacs\fR
467 Turns on emacs key bindings.
468 .IP \fBnoemacs\fR
469 Turns off emacs key bindings.
470 .RE
471 .\"
472 .\"     save editor configuration
473 .\"
474 .SS "Save Editor Configuration"
475 .PP
476 When using this entry from the 
477 .B settings 
478 menu, the user may choose to save the current configuration of 
479 the editor (see \fBInitializing ee from a 
480 file\fR above) to a file named 
481 .I .init.ee 
482 in the current directory or the user's home directory.  If a file named 
483 .I .init.ee 
484 already exists, it will be renamed 
485 .IR .init.ee.old .
486 .\"
487 .\"     Caveats
488 .\"
489 .SH CAVEATS
490 .PP
491 THIS MATERIAL IS PROVIDED "AS IS".  THERE ARE 
492 NO WARRANTIES OF ANY KIND WITH REGARD TO THIS 
493 MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE 
494 IMPLIED WARRANTIES OF MERCHANTABILITY AND 
495 FITNESS FOR A PARTICULAR PURPOSE.  Neither 
496 Hewlett-Packard nor Hugh Mahon shall be liable 
497 for errors contained herein, nor for 
498 incidental or consequential damages in 
499 connection with the furnishing, performance or 
500 use of this material.  Neither Hewlett-Packard 
501 nor Hugh Mahon assumes any responsibility for 
502 the use or reliability of this software or 
503 documentation.  This software and 
504 documentation is totally UNSUPPORTED.  There 
505 is no support contract available.  Hewlett-Packard 
506 has done NO Quality Assurance on ANY 
507 of the program or documentation.  You may find 
508 the quality of the materials inferior to 
509 supported materials. 
510 .PP
511 Always make a copy of files that cannot be easily reproduced before 
512 editing.  Save files early, and save often.
513 .SS "International Code Set Support"
514 .I ee 
515 supports single-byte character code sets (eight-bit clean), or the 
516 Chinese Big-5 code set.  (Other multi-byte code sets may function, but the 
517 reason Big-5 works is that a two-byte character also takes up two columns on 
518 the screen.)
519 .SH WARNINGS
520 The automatic paragraph formatting operation 
521 may be too slow for slower systems.
522 .SH FILES
523 .PP
524 .I /usr/local/lib/init.ee
525 .br
526 .I $HOME/.init.ee
527 .br
528 .I .init.ee
529 .SH AUTHOR
530 .PP
531 The software 
532 .I ee
533 was developed by Hugh Mahon.
534 .PP
535 This software and documentation contains 
536 proprietary information which is protected by 
537 copyright.  All rights are reserved. 
538 .PP
539 Copyright (c) 1990, 1991, 1992, 1993, 1995, 1996, 2001 Hugh Mahon.
540 .SH "SEE ALSO"
541 .PP
542 termcap(4), terminfo(4), environ(5), spell(1), ispell(1), lp(1), aee(1)
543