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