5.0. EDITORS


5.1. The VMS System Editor EDT

EDT is a line oriented editor available on Meena. An editor is a program which is used to create your own files. There are three basic operations an editor can do. These are:

1. moving

2. viewing

3. modifying

To begin editing a file type:

EDIT filename.ext [Return]

If no version number is given then the newest copy of the file will be selected. To create a new file you may give a file name which does not already exist.

EDT can be used in either screen-oriented mode, or line oriented mode. In screen-oriented mode, the file being edited is displayed on the terminal screen and a cursor can move around the file dynamically. In line-oriented mode, the file can be edited using typed commands.

5.1.1. SCREEN-ORIENTED EDT

The VMS editor can be used in screen-oriented mode with VT100-type terminals. It uses the VT100's numeric keypad to invoke editing functions and commands.

Once you enter the editor you will be given the first line of the file ([EOB] for a new file) and the asterisk (*) character. The asterisk is the line-oriented prompt in EDT.

TYPE C [Return] TO SWITCH TO SCREEN-ORIENTED MODE.

EDT copies the file that you want to edit into a workspace called a buffer. Any changes made to the file are done on this copied version. For this reason, when you leave the editor you must decide if you want the changes made to be saved under the original file name (with a new version number) or to be lost. To leave the editor and save the changes use the EXIT command. To leave the editor without saving the changes use QUIT. See the following sections to find out how to use the command-line interface to exit or quit.

5.1.1.1. KEYPAD FUNCTIONS

The keypad function layout is as follows:

The commands to use for the system editor are:


5.1.1.2. SPECIAL FUNCTION KEYS

Be sure that the [Num Lock] key is down to use the numeric keypad.

GOLD [PF1]

The [GOLD] key is used to envoke the bottom function (the one in shade) on each key of the keypad (see the keypad diagram). If the [GOLD] key is typed accidentally, type the RESET function to clear it.

The [GOLD] key can also be used to envoke a function several times, or repeat the same character several times: type the [GOLD] key and an integer (using the normal number keys, not the keypad), before typing the function or character key. For example, [GOLD] 50 * will produce a line of fifty asterisks.

HELP [PF2]

The [HELP] key normally displays the keypad diagram and other control features. If an invalid command is entered, the editor will beep and [HELP] can be used to display a short error message.

COMMAND [PF1] 7

The COMMAND function is used to enter commands that do not have a specific key associated with them. The command is processed when you press the [Enter] key on the keypad - this is the [+] key on an Eazy PC. You may NOT use the [Return] key to execute a command entered via the COMMAND function.

DELETE VT100 terminal - [DELETE]

Back Space Eazy-PC - [Back Space]

The key on the main keyboard deletes the character to the left of the cursor. [[Ctrl] C] and [[Ctrl] Z] can be used to cancel the current function. Neither of these control sequences will allow you to exit from the editor: EXIT or QUIT must be used.

5.1.1.3. INSERTION

Unless a command or function is in progress, the editor is always in insert mode. This means any characters typed except the editor function keys will be inserted to the left of the cursor.

OPEN LINE [PF1] 0

The OPEN LINE function inserts an end-of-line character to the left of the cursor, effectively moving the remainder of the line to the next line. If OPEN LINE function is used when the cursor is at the beginning of a line, it creates a blank line before the current line on which to insert new text.

SPECINS [PF1] 3

The SPECINS function insert special characters. With this function, the ASCII code for the character is typed in after typing the [GOLD] key. This is then followed by SPECINS function. For example, [GOLD] 27 [PF1] 3 inserts the character with ASCII code 27 (the ESC character). The number given is in decimal; octal values may be used by preceding the number with 0 (zero).

5.1.1.4. DELETION AND UNDELETION

There are several delete functions on the keypad as well as the [DELETE] or [Back Space] keys on the main keyboard. All of the delete functions operate from the current cursor position.

DEL C VT100 terminal - ,

Eazy-PC - [Scroll Lck]

Deletes the character under the cursor.

DEL W [-]

Deletes all the characters to the end of the current word, plus the space following the word.

DEL L [PF4]

Deletes everything up to and including the end-of-line character; this has the effect of moving the contents of the following line to the current cursor position.

DEL EOL [PF1] 2

Deletes the remainder of a line but not the end-of-line character.

Several of the delete functions also have corresponding undelete functions. Undeleting may be performed any time after the delete function was used, but will only undelete the last character/word/line deleted.

UND C VT100 terminal - [PF1] ,

Eazy-PC - [PF1] [Scroll Lck]

Undo the last DEL C function.

UND W [PF1] [-]

Undo the last DEL W function.

UND L [PF1] [PF4]

Undo the last DEL L function.

5.1.1.5. MOVING THE CURSOR

The arrow keys at the top of the VT100 keyboard or [PF7] to [PF10] keys at the bottom left of the Eazy-PC keyboard may be used to move the cursor anywhere within the file. There are also several functions available on the keypad.

TOP [PF1] 5

Moves to the top of the file.

BOTTOM [PF1] 4

Moves to the bottom of the file.

CHAR 3

Moves one character forward/backward.

WORD 1

Moves one word forward/backward.

EOL 2

Moves to the end of the current/previous line.

LINE 0

Moves to the beginning of the next/current line.

PAGE 7

Moves the cursor to the next/previous page. By default, a page is a formfeed ([[Ctrl] L]). The defaults page character(s) can be changed by using the COMMAND function and typing

SET ENTITY PAGE "string"

SECT 8

Moves the cursor to the next/previous section. By default, a section is 16 lines.

The direction of movement for the function keys is dependent on the current cursor direction. The direction the cursor moves is controlled by the ADVANCE and BACKUP functions. When the editor is envoked, the move functions cause the cursor to move in the forward direction (ADVANCE). By using the BACKUP function, all cursor movement will be backwards, towards the beginning of the file.

5.1.1.6. SEARCHING

To search for a specific string of characters in a file use the FIND function to specify the string, and the FINDNEXT function to move the cursor to the next occurrence of the string.

The FIND function will prompt you for the string to search for:

SEARCH FOR:

You may then type the string to search for and type the [Enter] key - [+] key on an Eazy PC. For example:

SEARCH FOR: NAME [Enter]

This would search for the first occurence of the string NAME. The FINDNEXT function would then allow you to search for any additional occurences of the specified string.

The direction of the search is controlled by the current cursor direction and may be altered at any time using the ADVANCE and BACKUP functions. Generally searching is done without regard to the case of alphabetic characters. For example, the search string "th" will find all strings "th", "Th", "TH", and "tH". If case is important, use the COMMAND function and type

SET SEARCH EXACT [ENTER]

To return to the more general search mode, use the command

SET SEARCH GENERAL [ENTER]

5.1.1.7. ALTERING TEXT

Blocks of text can be moved within the file by moving the block to the 'paste buffer'. To do this:

1) move the cursor to the beginning of the block and type the SELECT function. To reset the SELECT function type [GOLD] and the RESET function.

2) move the cursor to the end of the block

3) type the CUT function to move the block to the paste buffer, or the APPEND function to add the block to the end of the paste buffer. Note that this has the effect of removing the block from its current position in the file, but it can be replaced by using the PASTE function immediately.

4) move the cursor to new position and use the PASTE function. The block may be pasted in several locations because the paste buffer is not emptied after using the PASTE function. To specifically empty the buffer, use the COMMAND function and type

CLEAR PASTE [ENTER]

To replace a block of text with new text, the new text must first be put in the paste buffer. If the old text is a string that has been found with the FNDNXT function, type the REPLACE function to replace it with the contents of the paste buffer. Otherwise, use the SELECT function to set the beginning of the old text, move the cursor to the end of the block, and type the REPLACE function. The REPLACE function can be used to delete blocks of text by using an empty paste buffer.

When replacing text that has been found with FNDNXT function, the SUBS function can be used to combine the REPLACE function with another FNDNXT function. This allows several occurrences of a string to be changed using the [GOLD] key's multiple command format.

For example:

[FIND] specifies the string to be replaced

[FNDNXT] finds the first occurence of the string

[GOLD] 3[SUBS] performs REPLACE/FINDNEXT three times

This example replaces the first three occurrences of the string with the contents of the paste buffer, and moves the cursor to the fourth occurrence.

5.1.1.8. SUMMARY OF FUNCTIONS

Special functions

[PF1] GOLD envokes bottom function on other keys

[PF2] HELP displays keypad diagram or error messages

[GOLD] 7 COMMAND used to type in commands

[GOLD] . RESET clears current function

Insert and Delete Functions

[GOLD] 0 OPEN LINE inserts an end-of-line character after cursor

[GOLD] 3 SPECINS to insert special characters using their ASCII code

, DEL C deletes character at cursor

[GOLD] , UND C undeletes last deleted character

- DEL W deletes to end of current word

[GOLD] - UND W undeletes last deleted word

[PF4] DEL L deletes to end of current line (incl. end-of-line character)

[GOLD] [PF4] UND L undeletes last deleted line

[GOLD] 2 DEL EOL deletes to end of current line

Cursor Movement and Searching

4 ADVANCE set cursor direction forward

5 BACKUP set cursor direction backwards

[GOLD] 5 TOP moves to top of file

[GOLD] 4 BOTTOM moves to bottom of file

3 CHAR moves one character forward/backward

1 WORD moves one word forward/backward

2 EOL move to end of current/previous line

0 LINE moves to beginning of next/current line

7 PAGE moves forward/backward one page

8 SECTION moves forward/backward one section

[GOLD] [PF3] FIND used to specify a search string

[PF3] FNDNXT finds an occurrence of a search string

Altering Text

. SELECT specifies beginning of block of text

6 CUT moves block of text to paste buffer

9 APPEND adds block of text to end of paste buffer

[GOLD] 6 PASTE inserts contents of paste buffer at cursor

[GOLD] 9 REPLACE replaces selected block or current search string with contents of paste buffer

[GOLD] [ENTER] SUBS combines REPLACE and FNDNXT functions

5.1.2. LINE-ORIENTED EDT

Once you enter the editor you will be given the first line of the file ([EOB] for a new file) and the asterisk (*) character. The asterisk is the line-oriented prompt in EDT.

EDT copies the file you wish to edit into a workspace called a buffer. Any changes made to the file are done on this copied version. For this reason when you leave the editor you must decide if you want the changes made to be saved under the original file name (with a new version number) or to be lost. To leave the editor and save the changes use the EXIT command. To leave the editor without saving the changes type QUIT.

5.1.2.1. MOVING

To move around the file being edited you must change the pointer EDT has which keeps track of the current line. When you begin editing the current line which is the first line in the file. To set the current line to a different line in the file you can:

1. Type the absolute line number of the new line which you wish to be the current line.

*15 [Return] changes current line to line 15

2. Move a relative distance from the current line. This may be done by typing the RETURN key to increment the current line by one, the minus sign followed by RETURN to decrement the current line by one, or by giving a positive or negative offset from the current line, which is denoted by the period.

* --- [Return] go back 3 lines from the current line

* [Return] advance 1 line from current line

* . [Return] current line

* .+5 [Return] advance 5 lines from the current line

* .-8 [Return] go back 8 lines from the current line

The current line becomes the line which is printed on the screen when any of these commands is issued.

5.1.2.2. VIEWING LINES

To view lines, or look at what is currently entered on a line, the TYPE command, the search command, or the moving commands (as above) may be used.

The TYPE command is followed by the range of lines which you want to view.

* T 1:5 [Return] type lines 1 through 5

* T .+1:25 [Return] type lines current + 1 through 25

* T W [Return] type the entire (WHOLE) file

* T R [Return] type the REST of the file

* T E [Return] type the END of the file

The TYPE command will only change the line pointer if a starting line number is specified in the range.

The search command finds the first occurrence of the specified string and prints the line which contains it. The search begins at the current line and wraps around to the top of the file. The current line becomes the line where the string is located.

Format: 'string'

Example: * 'their'[Return]

finds the first line containing 'their' and prints the line.

5.1.2.3. MODIFYING TEXT

There are a number of EDT commands which are used to modify the text in a file. A summary of these follows (for more information see HELP in EDT):

SUBSTITUTE

Changes the first occurrence of a string on the specified lines to a new string.

Format: SUBSTITUTE/old string/new string/ [range]

Example: * S/elepahnt/elephant/ 10:20 [Return]

This changes the first occurrence of the string 'elepahnt' on the lines 10 through 20 to the word elephant.

INSERT

Insert text above the specified line. When text is finished being inserted control Z ([[Ctrl] Z]) is used to exit from insert mode. If no line number is specified text is inserted above the current line.

Format: INSERT [line]

Example: * I 5 [Return]

... type lines to be inserted...

[[Ctrl] Z]

*

This inserts the typed lines of text before line 5.

DELETE

Delete the specified lines from the file. If no lines are specified, then the current line is deleted.

Format: DELETE [range]

Example: * D 4:7 [Return]

This deletes lines 4 through 7.

MOVE

Moves a range of lines from one place to another in a file.

Format: MOVE range TO line_num

Example: * MO 1:10 TO 20 [Return]

This will move lines 1 through 10 to BEFORE line 20 and AFTER line 19.

COPY

Copy lines before another line in the file (results in 2 copies).

Format: COPY range TO line_num

Example: * CO 1:10 TO 20 [Return]

This will COPY lines 1 through 10 to BEFORE line 20. Original lines still remain.

REPLACE

Will delete the current line and enter insert mode. Control Z [[Ctrl] Z] must be typed to leave replace mode.

If no line number is specified the current line will be replaced.

Format: REPLACE [line]

Example: * REPLACE 5 [Return]

... enter lines to replace ...

[[Ctrl] Z]

*

This deletes line 5 and inserts the typed lines in its place.

INCLUDE

Reads a file into the editor buffer above the specified line. If no line is specified then the file is inserted above the current line.

Format: INCLUDE file.ext [line]

Example: * INCLUDE ASSIGN1.FOR 3 [Return]

This places all the text from the file ASSIGN1.FOR into the current file above line 3.

5.1.2.4. EDT QUALIFIERS

One qualifier which is very useful with EDT is the /recover qualifier. When an editing session terminates abnormally, a '.JOU' (journal) file is left in your account. None of the changes that you made during the editing session were made to the file. The '.JOU' file that appears in your account contains all the keystrokes that you entered.

If you wish to have that editing session take effect, then enter the next session by using the 'recover' option.

Format: EDIT/RECOVER file.ext

Example: $ ED/RECOVER ASSIGN1.FOR [Return]

This will recover all the changes which were made during the last time that you edited ASSIGN1.FOR when the edit session was terminated abnormally.

5.2. VI EDITOR

5.2.1. "ED" EDITOR

An early Unix editor was the line-oriented "ed", which was designed to run on any ASCII terminal. This editor was latter enhanced to take advantage of modern video terminal by providing a full screen mode. The result of this enhancenment was vi. Although ed is still available it has largely fallen into disuse with the advent of screen-oriented editors, such as vi.

5.2.2. VI EDITOR

One of the most commonly used screen editors under Unix is the "vi" editor. The following description is intended to be a simple starter summary. As with any editor, the more you use it, the more you take advantage of the full set of commands and options.

5.2.2.1. USING VI ON MEENA

Before vi is invoked on meena two commands must be issued. They are:

$ SETUP VI [Return]

$ SET TERM/VT100 [Return]

You only have to issue the above commands once because they remain valid until you log out. These commands can be added to your login.com file so that they are automatically executed every time you login in.

When an editing session terminates abnormally a '.TJL' file is left in your account. None of the changes that you made during the editing session were made to the file. The '.TJL' file that appears in your account contains all the keystrokes that you entered.

If you wish to have that editing session take effect, then enter the next session by using the 'recover' option.

Format: VI/RECOVER file.ext

Example: VI/RECOVER ASSIGN1.FOR [Return]

this will recover all the changes which were made during the last time that you edited ASSIGN1.FOR when the edit session was terminated abnormally

5.2.2.2. CALLING UP VI

Enter: vi filename [Return]

If the file exists, the first portion of it will appear on the screen. If the file does not exist then the message "new file" is displayed at the bottom of the screen.

5.2.3. USING THE VI EDITOR

There are two commands in vi which can be useful at any time. The first is the ESC character which is used to exit from append or insert mode as well as to cancel any partially formed command. The second is the period (.) which will repeat the last command entered without retyping the command. Also handy is the ability to execute a command more than once simply by typing the number of times it is to be done before typing the command.

Notice that the command letters are upper and lower case dependent.

5.2.3.1. INSERTING TEXT

Position your cursor at the desired location and enter one of the following characters. The letter you type will not be displayed because you are not yet in insert mode.

[i] insert before cursor position

[a] insert after cursor position

[O] insert before current line

[o] insert after current line

To end any insertion, type the X(Esc) key.

5.2.3.2. MOVING AROUND

The right hand fingers on the home row of the keyboard are used to position the cursor.

[h] move left one character

[j] move down one row

[k] move up one row

[l] move right one character

These entries must be in lower case; first time users can experience horrible results if a capital J is entered (capital J causes lines to be joined i.e. the carriage return is removed).

[[Ctrl] f] moves you forward one 'screen' at a time

[[Ctrl] b] moves you backward one 'screen' at a time

[G] moves you to the end of the file

To move to a specific area of a file, enter a slash (/) followed by a sufficient number of characters to identify the area of text you are searching for, and then type a carriage return. The following sequence occurs:

a) as soon as you type the slash, the cursor is moved to the bottom line of the screen.

b) when you have finished entering your search pattern and the carriage return, either:

i) you are moved to the desired location in the file.

ii) the cursor is returned to the point on the screen that is was at before you entered the slash and the message "pattern not found" is displayed at the bottom of the screen.

Note: that the slash causes a search from the current position forward; to search backwards, enter a question mark instead of a slash.

5.2.3.3. REPLACING TEXT

[r] replace the current character

[R] replace text starting from the cursor position

Replacement initiated by [R] must be terminated by typing the [Esc] key.

5.2.3.4. DELETING TEXT

[x] delete the current character

[d][d] delete the current line

5.2.3.5. COPYING TEXT

To move n line(s) of text, position your cursor on the first line to be moved. Enter n[d][d] to delete the n line(s). If no number is entered then only one line is deleted into the edit buffer. Now position your cursor at the line before you want the move to occur. Enter [p] to have the lines you just deleted placed at the new location.

To copy line(s) follow a similar procedure except that you enter nX(y)X(y) to 'yank' lines instead of deleting them.

5.2.3.6. CORRECTING A MISTAKE

Enter [u] to 'undo' the last command you entered.

5.2.3.7. EXITING VI

[:][q][!] exits vi without saving changes

[:][w][q] saves the file and then exits

[Z][Z] saves the file and then exits

5.2.4. VI COMMAND SUMMARY

VI (Visual) Editor Command Summary

Inserting Text

a add after cursor

A add to end of line

i insert before cursor

I insert before first nonblank

o open line below cursor

O open line above cursor

Deleting Text

dd delete line

dw delete word

x delete character under cursor

X delete character to left of cursor

D delete rest of line

Undo

u undo last change

U restore current line

Changing and Replacing Text

. repeat last change

r replace character under cursor

R write over text starting at cursor

~ change case

cw change word

J join

[Return] (in insert mode) split

: 1,$s/X/Y/opt

Global substitute X with Y

options:

g - change every occurrence in line

c - confirm each change

p - print changed lines

Copying and Moving Text

Y yank into buffer

p put buffer after cursor

P put buffer before cursor

Searching Text

/X search forward for X

?X search backward for X

n repeat previous search in the specified direction

N repeat previous search in the opposite direction

: g/pattern/p print every line with pattern in it

Patterns Within Searching

(must use set magic option first)

. any character

* any number of the preceeding pattern

[abc] a, or b, or c

[^abc] any character but a, b, and c

[a-b] any character between a and b

Screen

^ l clear and redraw

File Manipulation

: w name write to file name

: q! quit without saving changes

: wq write and quit

ZZ write and quit

: n edit next file

: n! edit next file, discarding changes to current

: r name read file name into buffer

Options

:set magic allow special search patterns

If a command is preceded with a number it will be repeated that number of times.

EX: 5dd will delete five lines

x(ESC) cancels any command u undo last command 

5.3. XEDIT EDITOR

Xedit is the system editor on all IBM VM/CMS systems. It has many features which allow it to edit very large files, as well as perform complex commands, user-defined macros, and so on. Part 5.3.6. of this chapter gives a detailed example of how to create a file with Xedit.

Enter XEDIT fn ft [fm] [Return] to call up the editor ( you can also use just X fn ft [fm] [Return]) to call up the editor. The filemode, fm, is optional, but should be used if you wish to edit a file on another disk other than your A disk. The following screen image will appear after you type the Xedit command:

Files are accessed by:

1. cursor control and PF keys

2. commands entered in the prefix command area

3. commands in the Xedit command line indicated by =====>

- To move to the correct spot in this line enter [PF12][1]

5.3.1. CURSOR CONTROL AND PF KEYS

To get a description of all PF keys type the following command on the Xedit command line:

Q PF [Return]

5.3.1.1. INSERT

Normally when you type, the characters already on the screen are overwritten. To change to insert mode 1) on a VT100 type the period key in the numeric keypad, 2) on an Act 4 type [[Ctrl] Y].

Alternately, to insert characters in a line, you can position the cursor on the character in front of which you wish to insert and enter [PF11]. When you have finished typing in what you want to insert, enter [PF11] again. This has the effect of splitting the line and then joining it around your insertion. Entering multiple lines is described in the prefix and Xedit command entry descriptions following.

5.3.1.2. CHANGE

To change characters simply position the cursor over the character(s) to be changed and retype them.

5.3.1.3. DELETE

To delete character(s) position the cursor and use the delete key.

5.3.1.4. MOVING ABOUT IN XEDIT

[PF7] can be used to display the previous portion of the file being edited.

[PF8] can be used to display the next portion of the file.

[PF12] moves you to the Xedit command line.

5.3.2. PREFIX COMMANDS

To enter a prefix command you must use the arrow keys to position the cursor in the prefix area. This area is marked by default with rows of equal signs. (The Xedit screen can be tailored so that line numbers appear instead of equal signs in the prefix area.) Note that you CANNOT enter a prefix area command if you have previously toggled 'insert-on' mode by entering the dot on the VT100 numeric key pad.

If the terminal beeps when you attempt to enter a prefix command, you have insert mode ON, simply toggle insert-off by typing the VT100 numeric keypad dot.

5.3.2.1. ADD LINES

a [Return] -- to add lines

A digit specifying the number of lines can be prefixed to the command.

For example: 12a [Return] would cause 12 blank lines to be added after the line where the command was entered.

|--------------------------------------------------------------------|

=====

=====

==12a=

=====

=====

Some people prefer to create blank lines and then type over them rather than going to insert mode by an Xedit command line entry.

5.3.2.2. DELETE LINES

d [Return]-- to delete lines (A number of lines can be specified.)

A digit specifying the number of lines can be prefixed to the command.

For example: d3 [Return] would delete the current line and the two subsequent lines.

You can delete one line at a time or mark a block of lines to be deleted by placing dd in the prefix area of the first and last line of the block.

dd -- to delete a block of lines

For example: put dd in the prefix area of the first line to be deleted, move the cursor to the prefix area of the last line to be deleted, put dd in the prefix area of the last line and press [Return].

5.3.2.3. COPY LINES

cc -- to copy a block of lines

c -- to copy only 1 line.

For example: type cc in the prefix area of the first line of the block to be copied then move the cursor to the last line of the block to be copied and again type cc. Move the cursor to the place where you want the lines to be put, type a p or and f in the prefix area followed by a [Return].

p -- places the block preceding the line you have moved to

f -- places the block following the line you have moved to

Example of the block copy sequence:

NOTE: Block markers can be deleted if you change your mind BEFORE entering carriage returns. This can be done by moving the cursor to the block markers and typing equal signs (=) over the block markers or by typing RES (reset) on the command line.

5.3.2.4. MOVE

mm -- to move a block of lines

m -- to move one line

For example: type mm in the prefix area of the first line of the block to be moved then move the cursor to the last line of the block to be moved and again type mm. Move the cursor to the place where you want the lines to be put, type a p or an f in the prefix area followed by a [Return].

5.3.2.5. CURRENT LINE

/ -- make the line indicated the current line; the current line is highlighted on the screen.

5.3.3. XEDIT COMMAND LINE ENTRIES

Note: use the arrow keys or enter [PF12] to move you to Xedit command line.

5.3.3.1. HELP

To retrieve help on Xedit commands, inside Xedit, type:

HELP [Return]

You will see a list of items that you can retrieve help on. You can scroll through the help items using scroll forward and scroll backward, [PF7] and [PF8]. You can select help on a specific topic by moving the cursor to that topic and pressing [Return].

If you know which command you want help on (for example, the SET command) you can type:

HELP SET [Return]

Use [F3] to exit help and return to the file you are editing.

5.3.3.2. FORWARD/BACKWARD

To move forward or backward 'n' lines from the current line type:

+n [Return] or -n [Return]

5.3.3.3. MOVING TO THE TOP OF THE FILE

To make the current line the top of file type:

TOP [Return]

5.3.3.4. MOVING TO THE BOTTOM OF THE FILE

To make the current line the bottom of file type:

BOTTOM [Return]

5.3.3.5. SETTING THE CASE OF CHARACTERS

To allow for upper and lower case characters. If you do not enter this, then whatever you have entered (whether you entered it as upper or lowercase) will be AUTOMATICALLY converted to upper case only.

SET CASE MIXED [Return]

5.3.3.6. SEARCH STRING

To locate a string.

/search-string/ [Return]

Note: Xedit starts the search from the current line to the end of the file

5.3.3.7. SEARCH/REPLACE STRING

C/search-string/replace-string/ [Return]

This will cause the search-string to be looked for in the current line; if found it is changed to replace-string. Only the first occurrence in the line is replaced. To have all occurrences on all lines replaced enter

TOP

then

C/search-string/replace-string/* * [Return]

Note: Xedit starts the search from the current line to the end of the file

5.3.3.8. TABS

SET TABS n1 n2 . . . [Return]

For example: for COBOL set tabs as:

SET TABS 8 12 16 [Return]

Note that you CANNOT use the [Tab] key to move from one tab stop to the next. You must instead use [PF4] to move to tab stops.

5.3.3.9. INSERT

To insert lines type:

I [Return]

To exit insert mode enter two [Return]s .

NOTE: Use line feed (LF) rather then [Return] for ending lines, or the screen will be redrawn every time you enter a line. When the input area is filled enter a [Return]. If you clear the screen before you press [Return] then your changes for that screen will be cleared and you will have to retype them. You do not have to press return if you are scrolling forward or backward with [PF7] and [PF8] since the return is automatically done for you.

NOTE: Insertion begins after the current line.

5.3.3.9.1. STRUCTURED INPUT

Structured input is a modification of insert. It only inserts one line, but when you press [Return], it automatically inserts a new empty line after the current one you are typing. Structured input will continue until you press two [Return]s in a row. To use structured input IN THE PREFIX AREA type:

si [Return]

5.3.3.10. RULER

To have a ruler (scale) on the screen type:

SET SCALE ON M [Return]

The "M" in the preceding command means place the ruler in the middle of the screen. You can also use "+n" and "-n" (in place of "M") to place the ruler n lines from the top, or n lines from the bottom of the screen, respectively.

5.3.3.11. LINE NUMBERS

To have line numbers in the prefix area of each line type:

SET NUM ON [Return]

5.3.3.12. RECORD FORMAT

To create fixed length RECord ForMat (RECFM) type:

SET RECFM F [Return]

A fixed record format means that all lines are of the same line record length.

To create variable length RECord ForMat (RECFM) type:

SET RECFM V [Return]

A variable record format means that each line can have a different length. This is sometimes useful, but in practice you should always use a fixed record format for your files.

5.3.3.13. LINE RECORD LENGTH

To set the length of a line in the file, called Line RECord Length (LRECL) type:

SET LRECL n [Return]

Where n is the length of the lines in the file. After you have set the line record length, it is suggested that you set the record format to fixed so the line record length is saved.

Warning: Reducing the line record length may truncate (cut off) the ends of lines. Make sure that you don't lower the length too much. If you inadvertently truncate the lines, simply quit the file (QQUIT) so no changes are made to the file.

5.3.3.13.1. INCREASING THE LINE RECORD LENGTH

You cannot make the line record length longer than what the original length of the file is. For example, if you edit a file that has a line record length of 80, you cannot change the length to 132, or anything greater than 80. However, there is a way for extending the length of the file.

To make the line record length longer than what you currently have:

1) Xedit your file by typing X fn ft [Return] where fn and ft is the filename and filetype of your file.

2) Type SET RECFM V [Return] to change the file to variable record format.

3) Type FILE [Return] to save the file as variable record format. You should now be in CMS.

4) Type X fn ft (WIDTH n [Return] where fn and ft is the filename and filetype of your file, and n is the longer record length that you desire.

5) Type SET RECFM F [Return] to lock the file at the new, longer record format.

6) Don't forget to use FILE to save your changes.

5.3.3.14. EXIT AND SAVE CHANGES TO A FILE

To save your file and exit Xedit type:

FILE [Return]

5.3.3.15. EXIT BUT DO NOT SAVE CHANGES TO A FILE

To abandon any changes and leave edit type:

QQUIT [Return]

5.3.3.16. SAVE CHANGES AND STAY IN XEDIT

Save the file without exiting Xedit by typing:

SAVE [Return]

5.3.3.17. RECOVER DELETED LINES

Bring back the last 'n' lines that had been deleted by using 'd' in the prefix area. (use '*' in place if a specific number of lines to recover all lines)

RECOVER n [Return]

5.3.3.18. CLEARING THE PREFIX AREA

To reset or clear the prefix area of unwanted commands, use

RES [Return]

5.3.4. EXITING FROM XEDIT AND SAVING THE FILE

To save your file and exit from the editor type FILE [Return] on the command line. To exit without saving type QQUIT [Return] on the command line. And to save without exiting from the editor type SAVE [Return] on the command line.

NOTE:When a file has been edited and you exit from the editor by typing FILE, the previous copy of the edited file is NOT saved. If a backup file is required, a copy may be made BEFORE editing the file by using the CMS command copy.

5.3.5. EDITING MULTIPLE FILES

NOTE: This section is best understood if you try it out with some test files on your account.

You can edit more than one file at the same time in Xedit. In fact, you can edit many files. The real limit is how much storage your userid has, but in practice it is however many files you can keep track of! It is not unheard of to simultaneously edit twenty files, but we don't recommend that you do that. Three is usually more than enough.

The files are stored in a ring configuration. This means that one file follows the other in the order that you edit them. You can switch from one file to the next. Once you reach the last file, Xedit "wraps around" and switches you to the first file you are editing. A ring configuration uses this wrapping feature.

You can also split the display screen and show the same file or different files on the screen AT THE SAME TIME. The screen can be split vertically or horizontally to show multiple windows. This allows you to edit different pieces of the same file, refer to other sections of a file, show pieces of different files, and so on. You can also copy data from one file to another file by using the PUT and GET commands.

5.3.5.1. EDITING MULTIPLE FILES

To edit multiple files, simply Xedit the first file, and then edit all other files from the command line in Xedit.

For Example, assume that we want to edit three files, ILOVEMAX PASCAL, HUGGA EXEC, and MUGGA PASCAL.

1) Edit the first file by typing (in CMS) X ILOVEMAX PASCAL [Return]. CMS will start the editor and will show you the file ILOVEMAX PASCAL on the screen

2) To edit the second file use the arrow keys or [PF12] to move the cursor to the command line (looks like "=====>"). Then edit the second file by typing X HUGGA EXEC [Return]. CMS will load in the file and will show you the file HUGGA EXEC on the screen. The file ILOVEMAX PASCAL will not be shown on the screen, but is still being edited.

3) To edit the third file, move to the command line and type X MUGGA PASCAL [Return]. CMS will load in the file and show you MUGGA EXEC on the screen. The files ILOVEMAX PASCAL and HUGGA EXEC will not be shown on the screen, but they are still being edited.

You now have all three files edited simultaneously .

5.2.5.2. SWITCHING BETWEEN FILES

To switch between files once they have been loaded into the editor, move the cursor to the command line and type X [Return]. This will scroll you to the next file. Continuously typing the command will scroll you through all files you are currently editing. Once you have reached the last file in the ring, another X [Return] will wrap around to the first file.

5.3.5.3. SAVING FILES AND LEAVING THE EDITOR

You can use the SAVE, FILE, and QQUIT commands as with editing one file. The only difference is that when you exit one file, the others are left in the editor, and you remain in Xedit. You remain in Xedit until you have exited (either by FILE or QQUIT) all files.

5.3.5.4. SPLITTING THE SCREEN

You can split the screen horizontally or vertically (but not both at the same time) to show different sections of the same file, or sections of different files. When you split the screen, you see several windows, each of which can display a piece of a file. Each window has it's own prefix area, data area, and command line. Commands typed in one window DO NOT affect files in other windows.

5.3.5.4.1. SPLITTING THE SCREEN HORIZONTALLY

To split the screen horizontally, move the cursor to the command line and type:

SET SCREEN n [Return]

Where n is the number of horizontal windows to create. In practice two or three windows are easy to use, but more windows make the files awkward to edit. You can scroll through the files by using the previously mentioned scrolling commands.

5.3.5.4.2. SPLITTING THE SCREEN VERTICALLY

To split the screen vertically, move the cursor to the command line and type:

SET SCREEN n V [Return]

Where n is the number of vertical windows to create. In practice two windows are easy to use, but more windows make the files awkward to edit. You can scroll through the files by using the previously mentioned scrolling commands.

5.3.5.4.3. RETURNING TO SINGLE SCREEN MODE

You can close all windows and return to viewing a single file on a full screen by moving the cursor to the command line and typing:

SET SCREEN 1 [Return]

This does not exit the files, they are just returned to their location in the ring. You can scroll through them by using the previously mentioned scrolling command.

5.3.5.5. COPYING AND MOVING BETWEEN FILES

You can copy or move data in between files by using the PUT and GET commands. The PUT command takes text from the currently edited file and places it in another. The GET command takes one file and places it inside the currently edited file. You cannot use the C, CC, M, MM, P, and F commands to copy and move in between different files.

5.3.5.5.1. EXTRACTING TEXT WITHOUT DELETING

To extract a section of the currently edited file (or the entire file) and place it in another file, use the "/" command to move the current line to the section of text you would like to extract, then move the cursor to the command line and type:

PUT n fn ft [Return]

Where n is the number of lines, starting at the current line, to extract. The extracted lines are placed in the file fn ft, where fn is the filename and ft is the filetype. You can PUT all lines, starting at the current line, and extracting to the end of the file, by using an asterisk (*) in place of n.

If you PUT into a file that already exists the new lines will be appended to the end of the file.

5.3.5.5.2. EXTRACTING TEXT WITH DELETING

THIS VERSION OF THE PUT COMMAND WILL EXTRACT THE TEXT SPECIFIED AND WILL DELETE THAT TEXT FROM THE FILE YOU ARE CURRENTLY EDITING.

To extract a section of the currently edited file (or the entire file) and place it in another file, use the "/" command to move the current line to the section of text you would like to extract, then move the cursor to the command line and type:

PUTD n fn ft [Return]

Where n is the number of lines, starting at the current line, to extract. The extracted lines are placed in the file fn ft, where fn is the filename and ft is the filetype. You can PUT all lines, starting at the current line, and extracting to the end of the file, by using an asterisk (*) in place of n.

If you PUTD into a file that already exists the new lines will be appended to the end of the file.

5.3.5.5.3. RETRIEVING TEXT

You can retrieve (import) text from any file into the file you are currently editing. Use the "/" command to move the current line to the section of text you would like to extract, then move the cursor to the command line and type:

GET fn ft [Return]

The lines are retrieved from the file fn ft, where fn is the filename and ft is the filetype, and are placed after the current line in the file.

5.3.5.5.4. COPYING STRATEGIES

There are several different ways to use PUT and GET, depending on what procedure you wish to perform. The following is a suggested way to copy and move text in between two different files.

To copy data from one file to another file:

1) Xedit the first file. Move the cursor in Xedit to the command line and Xedit the second file.

2) Move the current line to the data you wish to COPY FROM (Use the "/" command in the prefix area to set the current line). Use the PUT command to extract the text into a temporary data file. For example, use PUT 12 TEMP FILE [Return] to place twelve lines, starting at the current line, into a temporary file called TEMP FILE.

3) Switch to the second file. Move the current line to the location where you wish to COPY TO (Use the "/" command in the prefix area). Use the GET command to retrieve the data that you just stored. For example, use GET TEMP FILE [Return] and all twelve lines that you extracted in step 2 will be inserted after the current line.

4) Erase the temporary file by moving to and command line any typing CMS ERASE TEMP FILE A [Return].

To move data from one file to another file:

1) Xedit the first file. Move the cursor in Xedit to the command line and Xedit the second file.

2) Move the current line to the data you wish to MOVE FROM (Use the "/" command in the prefix area to set the current line). Use the PUTD command to extract the text into a temporary data file. For example, use PUT 12 TEMP FILE [Return] to place twelve lines, starting at the current line, into a temporary file called TEMP FILE. The twelve lines will be deleted from the current file, but are stored in TEMP FILE.

3) Switch to the second file. Move the current line to the location where you wish to MOVE TO (Use the "/" command in the prefix area). Use the GET command to retrieve the data that you just stored. For example, use GET TEMP FILE [Return] and all twelve lines that you extracted in step 2 will be inserted after the current line.

4) Erase the temporary file by moving to and command line any typing CMS ERASE TEMP FILE A [Return].

5.3.6. XEDIT TAILORING

Normally when you use Xedit the input area is split into two portions:

- top half on bottom half of screen

- bottom half on top half of screen

The solution is to create a file called PROFILE XEDIT to tailor the edit screen to your likes. The file PROFILE XEDIT is similar to the PROFILE EXEC file that is used when you log on. PROFILE XEDIT is a list of commands that are executed every time you edit a file, and can contain any Xedit, REXX, or CMS commands.

The following is an example of how you might tailor the screen. Note the tab setting is for COBOL. The first 2 lines of the file are comment lines; see the section on EXEC files for a more complete description.

/* REXX File called PROFILE XEDIT */

/* tailoring commands */

'set tabs 8 12 16 . . . 80' (substitute ". . ." by numbers)

'set curline on 4'

'set case mixed'

'set msgline on 24'

'set num on'

'set scale on 3'

'set cmdline top'

This PROFILE XEDIT file would cause the edit screen to be formatted in the following manner:

In addition to moving various lines, this also causes line numbers to placed in the prefix area. Simply type over top of the numbers to enter a prefix command as previously described.

For further information enter

HELP XEDIT SET [Return]

NOTE: A PROFILE XEDIT does not necessarily have to reconfigure the screen. The following could be used for the PASCAL students for example.

/* PASCAL PROFILE XEDIT */

'SET AUTOSAVE 10'

'SET RECFM F'

5.3.7. AN EXAMPLE OF AN XEDIT SESSION

(using the "PROFILE XEDIT" just described)

Call up the editor:

xedit test txt [Return] RUNNING

Xedit returns:

TEST TXT A1 F 80 . . .

=====> <cursor here>

|........|........|........|........|........|

00000 * * * TOP OF FILE * * *

00001 * * * END OF FILE * * *

At this point the cursor is positioned on the command line(i.e. to the right of "=====>").

Enter 'i [Return]' on the command line to get into edit insert mode and the follow is displayed.

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

<cursor here>

DMS*MD5731 INPUT MODE:

The cursor is now at the beginning of the line following the "TOP OF FILE" line. Now every time you type in a line followed by a carriage return, the current line will become the line you just entered and no other lines will appear below the ruler line.

For example:

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

Let's type a line [Return]

DMS*MD5731 INPUT MODE:

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

Let's type a line

<cursor here>

DMS*MD5731 INPUT MODE:

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

Let's type a line

More lines [Return]

DMS*MD5731 INPUT MODE:

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

More lines

<cursor here>

DMS*MD5731 INPUT MODE:

To get out of insert mode type another [Return] and the following will be displayed:

TEST TXT A1 F 80 . . .

=====> <cursor here>

|........|........|........|........|........|

00002 More lines

00003 * * * END OF FILE * * *

Note that the "Input Mode" message has disappeared from the bottom of the screen. To see the previous portion of the file enter [PF7]. You should see:

TEST TXT A1 F 80 . . .

=====> <cursor here>

|........|........|........|........|........|

00000 * * * TOP OF FILE * * *

00001 Let's type a line

00002 More lines

00003 * * * END OF FILE * * *

To save the file and exit enter "file" on the command line.

For example: =====> FILE [Return]

The screen will clear and you will be back at the operating system level.

To get back to editing, call up the editor as you did before.

xedit test txt [Return] RUNNING

The file will be displayed from the beginning.

TEST TXT A1 F 80 . . .

=====> <cursor here>

|........|........|........|........|........|

00000 * * * TOP OF FILE * * *

00001 Let's type a line

00002 More lines

00003 * * * END OF FILE * * *

Presumably at this point, you would want to continue entering lines. The current line is the "TOP OF FILE" line so entering "i [Return]" on the command line would get you into insert mode at the beginning of the file; however, it is more likely that you would want to insert at the end of the file. To accomplish this enter "bottom [Return]" on the Xedit command line and then enter "i [Return]" on the Xedit command line.

After the "bottom [Return]" command, you will see:

TEST TXT A1 F 80 . . .

=====> <cursor here>

|........|........|........|........|........|

00002 More lines

00003 * * * END OF FILE * * *

After the "i [Return]" command, you will see:

TEST TXT A1 F 80 . . .

=====>

|........|........|........|........|........|

* * * TOP OF FILE * * *

More lines

<cursor here>

DMS*MD5731 INPUT MODE:

Now continue entering lines as you did before. Remember that typing two [Return]s will get you out of insert mode and return the cursor to the command line area.

Also remember that you must type

FILE [Return]

on the command line to save your file and exit the editor.

5.4. THE KED EDITOR

The KED editor is a screen-oriented editor for VT100-type terminals. It uses the VT100's numeric keypad to invoke editing functions and commands. The keypad function layout is as follows:

GOLD HELP FINDNEXT DELLINE

FIND UNDELLINE

F1 F2 F3 F4

PAGE SECTION APPEND DELWORD

COMMAND FILL REPLACE UNDELWORD

7 8 9 -

ADVANCE BACKUP CUT DELCHAR

BOTTOM TOP PASTE UNDLECHAR

4 5 6 ,

WORD EOL CHAR ENTER

CHNGCASE DELEOL SPECINS

1 2 3

BLINE SELECT SUBSTITUTE

OPENLINE RESET

0 .

To call the editor, type

EDIT/CREATE filename.ext [Return]

- to create a new file

EDIT filename.ext [Return]

- to edit an existing file

- the original file will be saved as filename.BAK

EDIT/INSPECT filename.ext [Return]

- to look but not change the file

Exit from the editor by using the COMMAND function, [GOLD] X(COMMAND), and typing

EXIT [Enter] to save the current version and exit

QUIT [ENTER] to exit without saving

If you wish to use your PC to access the editor, Yterm software is available from Computing Services which emulates a VT100 terminal. The VT100 keyboard is mapped to the function keys as shown in the following table.

GOLD HELP FINDNEXT DELLINE

FIND UNDELLINE

X(F1) X(F2) X(F3) X(F4)

PAGE SECTION APPEND DELWORD

COMMAND FILL REPLACE UNDELWORD

X(F5) X(F6) X(F7) X(F8)

ADVANCE BACKUP CUT DELCHAR

BOTTOM TOP PASTE UNDLECHAR

X(F9) X(F10) X(X(Shift) X(F1)) X(X(Shift) X(F2))

WORD EOL CHAR ENTER

CHNGCASE DELEOL SPECINS X(X(Shift) X(F6))

X(X(Shift) X(F3)) X(X(Shift) X(F4)) X(X(Shift) X(F5))

BLINE SELECT SUBSTITUTE

OPENLINE RESET

X(X(Shift) X(F7)) X(X(Shift) X(F8))

5.4.1. SPECIAL FUNCTION KEYS

The GOLD key is used to invoke the bottom function on each key of the keypad (see the keypad diagram). If the GOLD key is typed accidentaly, type the RESET function to clear it. The GOLD key can also be used to invoke a function several times, or repeat the same character: type the GOLD key and an integer (using the normal number keys, not the keypad), before typing the function or character key. For example,

[GOLD] 50 *

will produce a line of fifty asterisks.

The HELP function normally displays the keypad diagram and other control features. If an invalid command is entered, the editor will beep and HELP can be used to display a short error message.

The COMMAND function is used to enter commands that do not have a specific key associated with them (e.g. EXIT and QUIT, described earlier).

The DELETE key on the main keyboard performs its usual function of deleting the character to the left of the cursor. [[CTRL] C] and [[CTRL] Z] can be used to cancel the current function. Neither of these control sequences will allow you to exit from the editor: EXIT [Enter] or QUIT [Enter] must be used.

5.4.2. INSERTING AND DELETING

Unless a command or function is in progress, the editor is always in insert mode. This means any characters typed will be inserted to the left of the cursor.

The OPENLINE function inserts an end-of-line character to the left of the cursor, effectively moving the remainder of the line to the next line. If OPENLINE is used when the cursor is at the beginning of a line, it creates a blank line above the current line on which to insert new text.

To insert special characters, use their control sequence (e.g. [[Ctrl] L] for formfeed), or the SPECINS function. With this function, the ASCII code for the character is typed in after typing the GOLD key. This is then followed by the SPECINS function. For example,

[GOLD] 27 [SPECINS]

inserts the character with ASCII code 27 (the ESC character), The number given is in decimal; octal values may be used by preceding the number with 0 (zero).

There are several delete functions on the keypad as well as the DELETE key on the main keyboard. All of the delete functions operate from the current cursor position. DELCHAR deletes the character under the cursor. DELWORD deletes all the characters to the end of the current word, plus the space following the word. DELLINE deletes everything up to and including the end-of-line character; this has the effect of moving the contents of the following line to the current cursor position. To delete the remainder of a line but not the end-of-line character, use DELEOL.

Several of the delete functions also have corresponding undelete functions. Undeleting may be performed any time after the delete function was used, but will only undelete the last character/word/line deleted.

5.4.3. MOVING THE CURSOR AND SEARCHING

The arrow keys at the top of the keyboard may be used to move the cursor anywhere within the file. There are also several functions available on the keypad:

TOP moves to the top of the file

BOTTOM moves to the bottom of the file

CHAR moves one character forward/backward

WORD moves one word forward/backward

EOL moves to the end of the current/previous line

BLINE moves to the beginning of the next/current line

A file is logically divided into sections and pages. By default, a section is 16 lines and a page is a formfeed [[Ctrl] L]. These defaults can be changed by using the COMMAND function and typing

SET PAGE "string" [Return]

SET PAGE integer LINES [Return]

SET SECTION "string" [Return]

SET SECTION integer LINES [Return]

The PAGE and SECTION functions move the cursor to the next or previous page/section, depending on the current cursor direction. The direction the cursor moves is controlled by the ADVANCE and BACKUP functions. When the editor is invoked, the move functions cause the cursor to move in the forward direction (ADVANCE). By using the BACKUP function, all cursor movement will be backwards, towards the beginning of the file.

To search for a specific string of characters in a file use the FIND function to specify the string, and the FINDNEXT function to move the cursor to the first occurrence of the string. The direction of the search is controlled by the current cursor direction and may be altered at any time using the ADVANCE and BACKUP functions. Generally searching is done without regard to the case of alphabetic characters. For example, the search string "th" will find all strings "th", "Th", "TH", and "tH". If case is important, use the COMMAND function and type

SET EXACT [Return]

To return to the more general search mode, use the command

SET GENERAL [Return]

5.4.4. ALTERING TEXT

Blocks of text can be moved within the file by moving the block to the 'paste buffer'. To do this, move the cursor to the beginning of the block and type the SELECT function. Then move the cursor to the end of the block and type the CUT function to move the block to the paste buffer, or the APPEND function to add the block to the end of the paste buffer. Note that this has the effect of removing the block from its current position in the file, but it can be replaced by using the PASTE function immediately.

To move the block to a new position, move the cursor to that position and use the PASTE function. The block may be pasted in several locations because the paste buffer is not emptied after using the PASTE function. To specifically empty the buffer, use the COMMAND function and type

CLEAR PASTE [Return]

To replace a block of text with new text, the new text must first be put in the paste buffer. If the old text is a string that has been found with the FINDNEXT function, type the REPLACE function to replace it with the contents of the paste buffer. Otherwise, use the SELECT function to set the beginning of the old text, move the cursor to the end of the block, and type the REPLACE function. The REPLACE function can be used to delete blocks of text by using an empty paste buffer.

When replacing text that has been found with FINDNEXT, the SUBSTITUTE function can be used to combine the REPLACE function with another FINDNEXT. This allows several occurrences of a string to be changed using the GOLD key's multiple command format. For example:

[FIND] specifies the string to be replaced

[FINDNEXT] finds the first occurence of the string

[GOLD] 3 [SUBSTITUTE] performs REPLACE/FINDNEXT three times

This example replaces the first three occurrences of the string with the contents of the paste buffer, and moves the cursor to the fourth occurrence.

5.4.5. SUMMARY OF FUNCTIONS

Special functions

[GOLD] invokes bottom function on other keys

HELP displays keypad diagram or error messages

[GOLD] COMMAND used to type in commands

[GOLD] RESET clears current function

Insert and Delete Functions

[GOLD] OPENLINE inserts an end-of-line character after cursor

[GOLD] SPECINS to insert special characters using their ASCII code

DELCHAR deletes character at cursor

[GOLD] UNDELCHAR undeletes last deleted character

DELWORD deletes to end of current word

[GOLD] UNDELWORD undeletes last deleted word

DELLINE deletes to end of current line (incl. end-of-line character)

[GOLD] UNDELLINE undeletes last deleted line

[GOLD] DELEOL deletes to end of current line

Cursor Movement and Searching

ADVANCE set cursor direction forward

BACKUP set cursor direction backwards

[GOLD] TOP moves to top of file

[GOLD] BOTTOM moves to bottom of file

CHAR moves one character forward/backward

WORD moves one word forward/backward

EOL move to end of current/previous line

BLINE moves to beginning of next/current line

PAGE moves forward/backward one page

SECTION moves forward/backward one section

[GOLD] FIND used to specify a search string

FINDNEXT finds an occurrence of a search string

Altering Text

SELECT specifies beginning of block of text

CUT moves block of test to paste buffer

APPEND adds block of text to end of paste buffer

[GOLD] PASTE inserts contents of paste buffer at cursor

[GOLD] REPLACE replaces selected block or current search string

with contents of paste buffer

[GOLD] SUBSTITUTE combines REPLACE and FINDNEXT functions

5.5. "EMACS" EDITOR

The "emacs" editor is very popular in some universities. At the time of this writing however, it has not gained a great deal of popularity locally. It is available however on our Unix systems.