Pressing Ctrl+G repeats a command line. You can set up execute complex sets of editing commands many times.
You can repeat a command a specified number of times by entering the number before the command. For example:
exchanges the next four occurrences of "rename" to "copy".
Us the RP (Repeat) extended command to repeat a command until ED returns an error, such as reaching the end of the file. For example:
moves the cursor to the top of the file, then exchanges all occurrences of "rename" with "copy". The T command (Top of File) changes all occurrences of Rename in the whole file. Otherwise, only the occurrences after the current cursor position are changed.
To execute command groups repeatedly, you can group the commands together in parentheses. You can also nest command groups. For example:
inserts three blank lines (the null string//) after every line containing Workbench.
To interrupt any sequence of extended commands, press any key during execution. If an error occurs, ED abandons the command sequence.
You can customize ED with commands that change the menus and function key setup. These commands can be entered individually within ED. They can also be saved as a script, such as S:Ed-startup, or as a file specified using the WITH argument. To execute the file from within ED, use the Run File (Esc,R,F) extended command. For information about changing the function keys, see page 4-15.
The following is the syntax for the Set Menu Item command:
SI <slot number> <slot type> /string1/string2/
The following table shows the slot types and functions used with the Set Menu Item command:
The following is an example script using the Set Menu Item and Enable Menu commands. Quotation marks are used as the delimiters.
SI 0 1 "Project"
SI 1 2 "Open . . . " "op ? /Open file:/"
SI 2 2 "Save ... " "sa"
SI 3 4
SI 4 2 "Quit!" "q"
SI 5 1 "Move"
SI 6 2 "Top" "t"
SI 7 2 "Bottom" "b"
SI 8 0
EM
This script produces the menus illustrated in Figure 4-4:
Figure 4-4. ED Custom Menu Example
Use the following steps to print a file that is open in the current ED window:
This prints the file, but does not save it to disk. If you wish to save the file you must select the Save menu item or Save As and a file name.
You can exit ED in one of the following three ways: