MAINEDIT User's Guide, Chapter 6

previous   next   top   contents   index   framed top   this page unframed


6. Inserting

6.1. Insert Mode

When MAINED is in insert mode, text input from the keyboard is inserted into the buffer. With each keystroke, the character typed is inserted at the current cursor position and the cursor is moved one column to the right. Any characters to the right are shifted one column to the right to make room for the new text. If a character is inserted beyond the last character on the current line, tab characters are inserted out to the current character position.

Table 6–1 shows how to enter insert mode from command mode. Type <ecm> to return from insert mode to command mode.

Table 6–1. Commands to Enter Insert Mode
Command Action
I enter insert mode
.I insert a line above current line, enter insert mode
n.I same as .I, except indent new line n columns

6.2. Special Keys in Insert Mode

The commands in
Table 6–2 have the effects shown. All of these commands leave you in insert mode.

Table 6–2. Effect of Special Keys in Insert Mode
Command Action
<bs> Move cursor left 1 column
<del> Delete the character to the left of the cursor, then move cursor left 1 column, except if at left margin, join current line to end of previous line (like -QJ command)
<tab> Insert tabs to next tab stop
<lf> Move cursor down 1 row
<eol> Break the line at the cursor into two lines, and put the cursor at the start of the second line (like QB command)

6.3. Inserting Lines or Characters

When modified by a count or emphasis, the I command inserts new lines, or inserts a character a specified number of times. These commands do not leave you in insert mode. In Table 6–3, x is any character.

Table 6–3. Commands to Insert Characters or Lines
Command Insert:
nIL n lines above current line, cursor to first inserted line (n is required)
QIL lines above current line to end of window, cursor to first inserted line
nICx n x's (n is required)
QICx x's to right margin

For example, to insert eight blanks at the cursor, type 8IC<sp>.

6.4. Inserting the Contents of a Buffer or File

The 1IB command prompts for the name of a buffer and inserts the contents of the specified buffer in the current buffer above the current line. The 1IF command prompts for the name of a file and inserts the contents of the specified file in the current buffer above the current line. See Table 6–4.

Table 6–4. Commands to Insert Buffers or Files
Command Insert:
1IB a buffer (name is asked)
1IF a file (name is asked)

6.5. Inserting Page Marks

Type P to insert an end-of-page character immediately ahead of the current line in the buffer.

MAINEDIT displays the end-of-page character on your screen with a page mark, as shown in Figure 1–2 of the MAINEDIT User's Guide. To delete the end-of-page character, place the cursor anywhere on the line containing the page mark, and issue the DL (Delete Line) command.

6.6. Inserting Characters by Code

Associated with each character (printing and non-printing) is a unique nonnegative integer, called a character code. MAINED provides a command for inserting a character by specifying its character code, thereby allowing you to insert a non-printing character such as a bell or escape.

The actual character code set used is dependent on your host operating system. For example, the character code for a blank on an ASCII host is 32, while that for a blank on an EBCDIC host is 64.

To insert a character by its code, type a single quote ('). MAINED prompts for the numeric character code in the message line at the top of the screen. Type the value of the character you wish to insert, followed by <eol>. The value can be entered in any of four radices, as shown in Table 6–5. For example, to insert an ASCII <del> character, type a single quote ('), and respond to the prompt in one of the following ways:

Char code127<eol>             (decimal)
Char codeB1111111<eol>        (binary)
Char codeO177<eol>            (octal)
Char codeH7F<eol>             (hexadecimal)

Table 6–5. The Four Radices Understood by the ' Command
Format Description
n... decimal digits n...
Bn... binary digits n...
On... octal digits n...
Hn... hexadecimal digits n...


previous   next   top   contents   index   framed top   this page unframed

MAINEDIT User's Guide, Chapter 6