home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
e2
/
e_ref
< prev
next >
Wrap
Text File
|
1994-01-30
|
17KB
|
646 lines
USING THE RAND EDITOR E
Mike O'Carroll
Microsystems Unit
University of Leeds
1. INTRODUCTION
This quick-reference manual assumes that you are familiar with the basic
operation of ned, an earlier version of e. If not, well, it's not that
difficult, anyway.
The editor may be used on any Lear Siegler type terminal (adm3a, adm5) or
equivalent. An IBM PC running uc has its keyboard programmed on start up;
the equivalent keys are indicated in column 3 below.
2. NOTATION
The sequence ^X means control-X, <NAME> means the key called NAME and N is
an integer. (CV), (CH) and (CVH) mean vertical, horizontal and diagonal
cursor move sequences respectively. <CMD> will normally be the <ESCAPE>
key.
The term close means that text is deleted and the space is closed up, while
erase means that the deletion is replaced by white space. References to
this file or current file mean the file which is in the active window indi-
cated by solid borders.
3. CURSOR MOVEMENT
cursor down @south@
cursor up @north@
cursor right @east@
cursor left @west@
cursor to top LH corner (home) <HOME> <Home>
cursor to bottom LH corner (end) <CMD><HOME> <End>
cursor to last line <CMD>@south@
cursor to first line <CMD>@north@
cursor to end of line <CMD>@east@
cursor to beginning of line <CMD>@west@
tab right <TAB> @east@|
tab left ^] |@west@
4. ENDING THE EDIT
exit and save all touched files ^Z
abort but save keystrokes ^E^Z
Other methods of exiting are described under the EXIT heading.
- 2 -
5. WINDOW MOVEMENT
down one page ^V <PgDn>
up one page ^G <PgUp>
down 10 lines ^D
up 10 lines ^U
down N pages <CMD>N^V
up N pages <CMD>N^G
down N lines <CMD>N^D
up N lines <CMD>N^U
down, put current line at top <CMD>^D
up, put current line at bottom <CMD>^U
down to end of file <CMD>^V
up to top of file <CMD>^G
right 16 columns ^R
left 16 columns ^X
right N columns <CMD>N^R
left N columns <CMD>N^X
right, put current column at left <CMD>^R
left, put current column at right <CMD>^X
mark first cursor position ^B <F3>
mark second position, goto first ^B
remove marks <CMD>^B <F6>
Note that any attempt to move the cursor beyond a window edge will cause
the window to shift in the appropriate direction. WARNING: marks delimit
the active area for block edit functions (qv).
6. CHARACTER EDITING
toggle insert/overwrite mode ^O <Ins>
erase/close character to left <RUB>
close character to right ^N <Del>
erase all chars to right <CMD>^N
erase/close all chars to left <CMD><RUB>
In insert mode, <RUB> closes, otherwise it erases.
7. LINE EDITING
insert blank line above current ^_ <F1>
delete current line ^Y <F2>
erase current line ^E^Y <Ctrl-F2>
split current line at cursor ^E^ <Alt-F1>
join next line to current ^E@south@ <Alt-F2>
See also the block editing functions.
8. STRING SEARCHES
search down for string <CMD>string^F
search up for string <CMD>string^T
search down for word at cursor <CMD>^F
search up for word at cursor <CMD>^T
repeat search down/up ^F/^T <F9>/<F10>
do current replacement (qv) ^E^E
do current, search for next ^E^F <Alt-F9>
do current, search for previous ^E^T <Alt-F10>
- 3 -
9. BLOCK EDITING
Block moves are achieved using the close, erase and pick buffers; use of
the last allows copying of text.
insert a blank line ^_ <F1>
insert N blank lines <CMD>N^_
insert several blank lines ^B(CV)^_
insert a blank block ^B(CVH)^_
pick up current line ^A <F4>
pick up N lines <CMD>N^A
pick up several lines ^B(CV)^A
pick up several columns ^B(CH)^A
pick up a rectangular block ^B(CVH)^A
put down last picked block <CMD>^A <F5>
close current line ^Y <F2>
close N lines <CMD>N^Y
close several lines ^B(CV)^Y
close several columns ^B(CH)^Y
close a rectangular block ^B(CVH)^Y
put down last closed block <CMD>^Y <F7>
erase current line ^E^Y <Ctrl-F2>
erase N lines <CMD>N^E^Y
erase several lines ^B(CV)^E^Y
erase several columns ^B(CH)^E^Y
erase a rectangular block ^B(CVH)^E^Y
put down last erased block <CMD>^E^Y <Ctrl-F7>
close next word ^E^N
put down last closed word <CMD>^E^N
10. MISCELLANEOUS
set a tab stop at cursor ^@at@ use TAB
remove the tab stop at cursor <CMD>^@at@ command
remove all tabs ^E^@at@ below
redraw a clean screen ^E<HOME> <Ctrl-Home>
interrupt search or replace (qv) ^C
switch to next window (qv) ^W <Alt-F8>
put alternate file (qv) in
current window ^E^W <F8>
recall previous command string ^E^A <Alt-F5>
11. INTERNAL COMMANDS
These are built-in commands which require a combination of control and
printing characters; they are always given on the command line. Some of
them duplicate functions described above.
11.1. BOX
draw a box ^B(CVH)<CMD>box<CR>
If (CVH) is (CH) only, a horizontal line will be drawn. To draw a vertical
line, make (CVH) such that (CH) moves one column only.
- 4 -
11.2. CENTRE
centre current line <CMD>cen<CR>
centre N lines <CMD>N cen<CR>
centre several lines ^B(CV)<CMD>cen<CR>
insert original text <CMD>ins a<CR>
The width (default 74) for centering, filling and justifying may be changed
using SET.
11.3. CLOSE
close current line <CMD>clo<CR>
close N lines <CMD>clo N<CR>
close a block ^B(CVH)<CMD>clo<CR>
restore last closure <CMD>-clo<CR>
11.4. COMMAND MODE
enter command mode <CMD>com<CR>
leave command mode <CMD>-com<CR>
11.5. COVER
Normally, when text blocks are put down, existing material is pushed down
(for vertical blocks) or sideways (for horizontal or rectangular blocks).
This command causes the dropped text to overwrite what is there.
cover with pick buffer <CMD>cov p<CR>
cover with close buffer <CMD>cov c<CR>
cover with erase buffer <CMD>cov e<CR>
11.6. DELETE
delete current file (permanently) <CMD>del<CR>
11.7. EDIT
edit another file in this window <CMD>e altfile<CR>
switch to alternate file (if any) <CMD>e<CR>
11.8. ERASE
erase current line <CMD>era<CR>
erase N lines <CMD>era N<CR>
erase a block ^B(CVH)<CMD>era<CR>
put back last erasure <CMD>-era<CR>
- 5 -
11.9. EXIT
exit: save file and state <CMD>ex<CR>
nosave: save state but not file <CMD>ex n<CR>
quit: don't save state or file <CMD>ex q<CR>
abort: save keystrokes for replay <CMD>ex a<CR>
On a normal exit, all files which have been modified during the edit are
updated; however, it is possible to save files selectively by turning off
the default setting - see the internal UPDATE command below.
11.10. FILL
fill text to end of paragraph <CMD>fil<CR>
fill next N paragraphs <CMD>fil Np<CR>
fill next N lines <CMD>fil Nl<CR>
insert original text <CMD>ins a<CR>
11.11. GOTO
goto start of file <CMD>go<CR>
goto line number N <CMD>go N<CR>
ditto <CMD>N<CR>
goto end of file <CMD>go e<CR>
goto beginning of range (qv) <CMD>go rb<CR>
goto end of range <CMD>go re<CR>
11.12. JOIN
join next line onto current <CMD>joi<CR>
split line at cursor <CMD>-joi<CR>
11.13. JUSTIFY
justify rest of current paragraph <CMD>jus<CR>
justify next N paragraphs <CMD>jus Np<CR>
justify next N lines <CMD>jus Nl<CR>
insert original text <CMD>ins a<CR>
11.14. NAME
rename current file <CMD>nam newname<CR>
11.15. OPEN
open one line above current <CMD>ope<CR>
open N lines <CMD>ope N<CR>
open several lines ^B(CV)ope<CR>
open block ^B(CVH)ope<CR>
- 6 -
11.16. PICK
pick up current line <CMD>pic<CR>
pick up N lines <CMD>pic N<CR>
pick several lines ^B(CV)<CMD>pic<CR>
pick rectanglar block ^B(CVH)<CMD>pic<CR>
insert last picked block <CMD>-pic<CR>
11.17. RANGE
limit search/replace to N lines <CMD>ran N<CR>
limit search/replace by cursor ^B(CV)ran<CR>
remove range limiting <CMD>-ran<CR>
reinstate last range limits <CMD>ran<CR>
display no. of lines in range <CMD>?ran<CR>
11.18. REDRAW
redraw the screen <CMD>red<CR>
11.19. REPLACE
replace old with new <CMD>rep /old/new/<CR>
replace, next N lines only <CMD>rep N /old/new/<CR>
replace, next N paragraphs <CMD>rep Np /old/new/<CR>
replace over marked area ^B(CV)<CMD>rep /old/new/<CR>
replace, but search backwards <CMD>-rep /old/new/<CR>
replace, showing each occurrence <CMD>rep s /old/new/<CR>
start interactive replacement <CMD>rep i /old/new/<CR>
The methods of limiting the replacement area apply to all forms. The
string delimiters may also be ", *, $, + or '. See STRING SEARCHES above
for how to proceed with interactive replacement.
11.20. SAVE
save a copy of the current file <CMD>sav savename<CR>
The name savename must be different to that of the file(s) being edited.
11.21. SET
lines for vertical moves [10] <CMD>set lin N<CR>
pages for vertical moves [1] <CMD>set pag N<CR>
columns for horizontal moves [16] <CMD>set win N<CR>
page width [74] <CMD>set wid N<CR>
bell near end of line <CMD>set bel<CR>
no bell near end of line <CMD>set nobel<CR>
hyphenation on <CMD>set hy<CR>
hyphenation off <CMD>set nohy<CR>
left margin at column N [0] <CMD>set lm N<CR>
right margin at column N [74] <CMD>set rm N<CR>
display current settings <CMD>?set<CR>
The figures in [] are the defaults.
- 7 -
11.22. SPLIT
split current line at cursor <CMD>spl<CR>
rejoin split line <CMD>-spl<CR>
11.23. TAB
set extra tab at cursor position <CMD>tab<CR>
set tabs at columns N, M, ... <CMD>tab N M ...<CR>
remove tab at cursor position <CMD>-tab<CR>
remove tabs at columns N, M, ... <CMD>-tab N M ...<CR>
set extra tabs every N columns <CMD>tabs N<CR>
remove all tabs <CMD>-tabs<CR>
set tabs to column nos. in file <CMD>tabfile filename<CR>
11.24. TRACK
move alternate file by same number
of lines as current one <CMD>tra<CR>
turn off tracking <CMD>-tra<CR>
11.25. UPDATE
update current file on exit <CMD>upd<CR>
don't update file on exit <CMD>-upd<CR>
The latter is useful when editing multiple files to prevent accidental
changes to a file which is just being looked at.
11.26. WINDOW
create a window into newfile <CMD>w newfile<CR>
create new window in current file <CMD>w<CR>
remove last window created <CMD>-w<CR>
To create a horizontal window, place the cursor on the left margin first.
To create a vertical window, place it on the top margin.
12. EXTERNAL COMMANDS
Many ordinary system commands may be executed from the editor. The speci-
fied area of the current file is used as standard input, and is replaced by
the standard output of the command.
run command using current line <CMD>run cmd<CR>
run command over N lines <CMD>run N cmd<CR>
run command over several lines ^B(CV)<CMD>run cmd<CR>
To leave the original lines untouched, use feed instead of run. All com-
mands may take their usual arguments.
12.1. TEMPORARY ESCAPES
save files, call up the shell <CMD>sh<CR>
save files, call a command <CMD>cal cmd<CR>
- 8 -
12.2. EXAMPLES
sort next N lines <CMD>run N sort<CR>
insert date at current line <CMD>feed date<CR>
list directory, return to edit <CMD>cal ls -l<CR>
13. VARIATIONS ON COVER
The following assume that a block of text is already in the pick buffer.
write a space for each printing
character in the buffer <CMD>blot<CR>
write a space for each space in
the buffer <CMD>-blot<CR>
overlay file with printing
characters from the buffer <CMD>over<CR>
underlay: as above but only spaces
in the file are affected <CMD>under<CR>
All the above work with the close and erase buffers too: the corresponding
commands are blot c, blot e, etc. Some experimentation is recommended!
14. MISCELLANEOUS
Unless otherwise stated, turn mode off by preceding with a '-':
enter auto wrap mode <CMD>wp<CR>
searches use regular expressions <CMD>re<CR>
don't display CRs; if any exist
change NL to CR-NL on exit <CMD>cr<CR>
cursor sticks at side margins <CMD>set sti<CR>
no stick, window rolls sideways <CMD>set nosti<CR>
change block to upper case ^B(CVH)<CMD>cap<CR>
change case in block ^B(CVH)<CMD>cca<CR>
help <CMD>h<CR>
15. DISASTER RECOVERY
The effect of most functions and commands can be reversed, provided that
this is done straight away. All deleted and adjusted text blocks are put
into the temporary file #o which may be brought onto the screen using the
EDIT command and picked from. All picked text is saved in #p. Both files
are deleted on exit from the editor.
If an edit is aborted for any reason, it may be replayed and interrupted
just before the disaster point; this requires a quick trigger finger at
9600 baud, however! Replays are tricky; make copies of all affected files
before trying one.
Each edit session leaves a "comma file", which is a copy of the previous
version of a file with the name prefixed with a comma. For this reason,
filenames should be restricted to 13 characters. Remember that restarting
the editor will destroy the previous comma file; in any case, comma files
are deleted periodically by the system.
- 9 -
16. SEE ALSO
The command line options are described in man 6 e.
--
Mike O'Carroll, Department of Electronic & Electrical Engineering,
The University, Leeds, LS2 9JT, UK
E-mail: @ukc.ac.uk:mike@ee.leeds[.ac.uk]
uucp: ...!mcsun!ukc!lena!mike OR mike@lena.uucp