ivi Typing Operations

Although we have already briefly described the action of the character and cursor keys in the Basics webpage, we include them again here, both for completeness and to allow us to provide additional details.

This page may be read in its entirety (recommended) or the following links may be used:

Basic typing operations

Operation: Normal typing (text and records)

Purpose: Enter a character in the corefile

Default Keys: see below

Operation Number: 2, 3 or 4

The character typed at the keyboard is entered into the corefile at the position of the cursor, generally replacing the one already there (in TYPING submode), or being inserted before it (in INSERT submode). In the case of records, a character is lost at the end of a field if the new one is inserted when the field is full (and a beep occurs).

For digits, punctuation, basic symbols and the letters of the English alphabet, the standard keys are used.

Non-English characters

ivi assumes a one to one mapping from character to byte. When this happens, as in any non-accented text in the Roman alphabet, it will show the character. However, when handed a text in a format like UTF-8, where characters may be represented by one, two, or more bytes, ivi will not show the characters. For example, a sequence like "une école" will appear as "une ?~cole". If you are typing strictly in English, this issue will not arise.

In order to use accented characters, ivi assumes the ISO-8859-1 (Latin1) character set, where each character, including accented ones, maps to a single byte. If you are planning to use ivi with accented characters, make sure your shell is set to ISO-8859-1.

ivi also assumes that everything entered into it is an 'operation' based on keystrokes. So, typing "t" is an operation that inserts that letter, while typing Control c is also an operation which puts the text in command mode. If you are reading in a file containing Latin 1 characters, ivi will display them normally. However, if you attempt to paste a block of text containing Latin 1 characters into ivi's editing window, it will react badly, since it will interpret some of the accented characters as special operations. As a workaround, save the pasted block as a file, then read it in.

ivi does provide mechanisms for entering a subset of accented characters (currently, those needed to enter French or Mohawk) by sequences of keystrokes, as the following list illustrates.

á (a acute)
Type Esc a
à (a grave)
Type Esc Esc a
â (a circumflex)
Type Esc A (NB: uppercase A)
é (e acute)
Type Esc e
è (e grave)
Type Esc Esc e
ê (e circumflex)
Type Esc E (NB: uppercase E)
í (i acute)
Type Esc i
ì (i grave)
Type Esc Esc i
î (i circumflex)
Type Esc I (NB: uppercase I)
ó (o acute)
Type Esc o
ò (o grave)
Type Esc Esc o
ô (o circumflex)
Type Esc O (NB: uppercase O)
ù (u grave)
Type Esc Esc u
û (u circumflex)
Type Esc U (NB: uppercase U)
ç (c cedilla)
Type Esc c

In addition, if you place the cursor over an accented character that you have entered and press Control l (the letter l), ivi will cycle through the various other forms of the character. So, for example, typing Control l repeatedly over the character "é" will show "ê", "ë", "È", "Ê", "Ë", "è", and so on throughout the cycle.

No default key sequences exist for other Latin-1 characters, such as n-tilde, though it is possible create them by changing key assignments. These characters can also be FEtched in files.

WARNING: No attempt should be made to introduce the character y-umlaut into a corefile. Its Latin-1 value, 255 or -1, is used as an internal flag byte, and its use as a character may cause a variety of damaging effects.

Three different "operation numbers" are used for character keys:

Operation: Cursor return

Purpose: Move the cursor to the start of the next record or the left margin of the next text line.


Operation Number: 1

This operation has three variants, which can be selected with the EDitor option command. The default is option 1. If option 0 has been selected and the editor is currently in INSERT submode, a new line or new record will be inserted and the cursor will be moved to the left margin of a text line or start of the new record.

If option 2 has been selected and the cursor is currently on the bottom line of the displayed section, a new page will be displayed before cursor is moved, and the cursor will therefore appear at the top of the new page. This is particularly useful if you write a function or procedure to process each line of a long text, since it saves the return operation having to redisplay a whole page before every line.

Either key may be used. CTRL M and CTRL J are synonymous with RETURN and LINEFEED respectively. (This is meant literally. The byte corresponding to RETURN is the same as the one corresponding to CTRL M, etc.) You are advised not to reassign LINEFEED, since this affects some other activities too.

Insertion operations

Operation: Insert mode

Purpose: Toggle the editor between INSERT and TYPING submodes.

Default Key: CTRL W

Operation Number: 22

Operation: Insert line

Purpose: Insert a new text line or record following the cursor line and move the cursor to it.

Default Key: CTRL F

Operation Number: 10

A new text line will be blank. A new record will comprise a number of empty fields, with the number of fields being specified by default or set by the user.

Operation: Insert several lines

Purpose: Insert several new text lines or records following the cursor line

Default Key: ESC ESC h number RETURN

Operation Number: 93

One of the few IVI operations (as distinct from commands) which requires a parameter. number denotes any integer. It is terminated by the RETURN or indeed by any non-digit (which is thrown away). This many new lines or records are inserted below the cursor line. The cursor is not moved.

Deletion operations

Operation: Delete

Purpose: Delete the character under the cursor

Default Key: DEL or BACKSPACE

Operation Number: 5

The Delete operation deletes the character under the cursor and moves the rest of the line one place left to close up the gap. If the cursor is beyond the right hand end of a line, a cursor left is performed. If the cursor is immediately to the right of the last character on the line, the cursor is moved to the left and the last character is deleted. If the cursor is in column 1 of an empty line (other than the last line of the file), the operation removes the line.

Text characters cannot be deleted while the corefile is set to a record view, nor can record characters be deleted while the corefile is set to text view. Attempts to delete a | symbol from a record in record/text view simply move the cursor left.

The 80 most recently deleted characters are stored in a circular buffer, and can be recovered by the Recover character operation. The latter allows recovery of items deleted accidently, and permits a short string to be moved from one place to another.

Either key may be used. CTRL H is synonymous with BACKSPACE.

Operation: Long delete

Purpose: Delete characters from the cursor to the end of line

Default Keys:

Operation Numbers: 69

All of the characters are placed in the recovery buffer.

Operation: Delete word / Delete field

Purpose: (For text view) Delete the word containing the cursor; (for record views) delete the field containing the cursor

Default Keys: ESC CTRL D

Operation Number: 79

All of the characters are placed in the recovery buffer. For record views, a backslash character is placed in the buffer to mark the end of the field.

Operation: Delete end of word

Purpose: Deletes the current word from the cursor onwards

Default Key: ESC ESC W

Operation Number: 80

All of the characters are placed in the recovery buffer.

Copying and Recovering

Operation: Recover character

Purpose: Remove the last character from the delete buffer and insert it at the cursor position.

Default Key: CTRL u

Operation Number: 65

The character is inserted regardless of the TYPING or INSERT submode. The cursor is not moved.

Characters are recovered from the buffer in reverse order of their deletion, but because the cursor is not moved, repeated use reinserts a string in its original order, provided that it was deleted from its beginning. (Note, though, that if the phrase was removed by deleting it backwards from the end of a line, recovery will be in the wrong order.)

Delete and Recover character can be used to move a phrase from place to place.

Operation: Copy character

Purpose: Copy the character at the cursor into the delete buffer for subsequent recovery. The cursor moves right.

Default Key: CTRL g

Operation Number: 11

This is the inverse of Recover character. The two can be used to copy a phrase from place to place.

Operation: Copy field

Purpose: (For record views only) Copy the field containing the cursor into the delete buffer for subsequent recovery.

Default Key: ESC CTRL b

Operation Number: 78

A backslash character is placed in the buffer to mark the end of the field.

For text view, this key sequence invokes Repeat line

Operation: Recover field

Purpose: (For record views only) Recover a field from the delete buffer and insert it at the cursor position.

Default Key: ESC CTRL t

Operation Number: 40

The backslash character which marks the end of the field in the buffer is discarded.

Cursor Movements

Operation: Cursor left, right

Purpose: Move the cursor one position left or right, adjusting the window if necessary.

Default Keys: left, right

Operation Number: 17, 19

For historic reasons, Cursor right is also assigned to CTRL X.

Operation: Cursor up, down

Purpose: (For text and record/text views) Move the cursor one line up or down, adjusting the window if necessary; (for record/template view) move the cursor to the previous or next field.

Default Keys: up, down.

Operation Number: 18, 20

If the cursor is moved above the first line/record of the corefile or below the last, a new line/record is inserted.

Note that in record/template view, moving the cursor to the next or previous record is the same as moving it to the next or previous page. It was therefore considered more convenient to provide arrow-keys for the next and previous field operations than to duplicate the page ones.

For historic reasons, these operations are also assigned to CTRL z and CTRL k respectively.

Operation: Next, previous page

Purpose: Move the window down or up one page

Default Keys: CTRL q, CTRL p

Operation Number: 30, 28

Note that in the case of text and record/text views, one page amounts to 20 or 30 lines; in record/template view, a page contains a single record.

Operation: Ascend, descend

Purpose: (Record views only) move the cursor to the previous or next field. Note, works only in OBject 1 mode in the case of descend.

Default Keys: CTRL r, TAB

Operation Numbers: 23, 34

CTRL i is a synonym for TAB.

In text view, these keys invoke the Reformat and Tab cursor operations respectively.

Operation: Long cursor left

Purpose: Move the cursor to the start of line

Default Keys:

Operation Number: 66

Why so many alternative key-sequences? (1) is the sequence originally intended, but the default key assignments achieve this only for an environment emulating a Sun shelltool console-keyboard. There is a conflict between these assignments and the ones needed for a vt100, so the defaults cannot include both simultaneously. Alternative (2) was therefore added to provide as a common sequence between the two. (b, by the way, stands for backwards.) (3) is merely a byproduct of the settings for (1).

(4) is convenient only because NUMBERPAD 5 on the Sun console keyboard is set to have the same effect as ESC ESC. Thus (4) is equivalent to NUMBERPAD 5 left, two keys which happen to be adjacent.

Operation: Long cursor right

Purpose: Move the cursor past the end of line

Default Keys:

Operation Number: 68

This operation places the cursor on the space following the last non-blank on the line. Note that in spite of the name of the operation, it may move the cursor leftwards!

For comments on the alternative key-sequences, see the previous operation. (f stands for forwards.)

Operation: Next, previous word

Purpose: Move the cursor to the start of the next, previous word

Default Key: ESC ESC n, ESC ESC p

Operation Number: 81, 82

Operation: Next number

Purpose: Move the cursor past the current numerical expression

Default Key: ESC ESC m

Operation Number: 95

This is very similar to Next word, but it skips over only characters which may form a numerical expression. It is intended for use with the arithmetical operations.

Cycling and Repeating

Operation: Cycle characters

Purpose: Change case or cycle through accented forms

Default Key: CTRL l (NB: the letter l)

Operation Number: 92

We have mentioned this operation earlier in connection with accented characters, but it actually serves two slightly different purposes. If the cursor is on a letter of the English alphabet, the letter is changed from upper- to lower-case, or vice versa, and the cursor is moved right. Repeated application therefore allows a phrase to be capitalized or "lowered". If the cursor is on an accented vowel (or ç), the letter is changed to another accented form of the vowel, and the cursor is not moved. So, repeated application cycles the vowel through all its accented forms, both upper- and lower-case. Non-letters are not changed, but the cursor moves right.

Currently IVI makes no use of "composed" keys (wherein the user types, say, e BACKSPACE ^ to enter ê), so that keys for extra characters are in short supply. The cycle operation reduces the need for more keys, but has two disadvantages. Firstly, it is a TYPING/INSERT mode operation, and cannot be used to enter characters in the command line, say, for specifying a FInd parameter. Secondly, some of the Latin-1 characters (the Spanish n-tilde and the Icelandic eth, for example) are not in any cycle, and cannot be entered in this way.

There are workarounds in both cases, which we leave to the entertainment of the reader!

Operation: Repeat character

Purpose: Copies the character from the line above the cursor and types or inserts it at the cursor position

Default Key: ESC ESC t

Operation Number: 77

Operation: Repeat line

Purpose: (For text view only) Copies the line above the cursor starting at the cursor column, and types or inserts it at the cursor position

Default Key: ESC CTRL b

Operation Number: 78

For record views, this key sequence invokes Copy field.

Splitting and Joining Lines

Operation: Split line

Purpose: Split the cursor line in two at the cursor

Default Key: ESC ESC s

Operation Number: 75

Operation: Join line

Purpose: Join the cursor line and the next line into one

Default Key: ESC ESC j

Operation Number: 76