# Introduction to Using TECO / VTEDIT on OS/8

## by Rick Murphy (ed. by Warren Young)

To edit a file with TECO or VTEDIT, just use the ".TECO file" command.
If you have a date set, even an incorrect one due to OS/8's inability to
handle post-Y2K dates, then the CCL will remember the last file edited
so you can just type "TECO" to re-edit.

VTEDIT for OS/8 uses the following keypad layout:

          +-------+-------+-------+-------+ 
          | "PF1" | "PF2" | "PF3" | "PF4" |     
          | Save  | TECO* | Paste |       |       ^D Kill rest of line*
          | Text+*|command| text  |       |     
          +-------+-------+-------+-------+ 
 All (*)  |  "7"  |  "8"  |  "9"  |  "-"  |
 commands | Open  | Page* | Mark/ | Search|       ^K Kill line+*       
 take opt | line* |       | quote*| arg * | 
 arg as:  +-------+-------+-------+-------+
 ESC [-]  |  "4"  |  "5"  |  "6"  |  ","  |
 <digits> | Up    | Delete|Delete/| End of|       ^U Kill start of line
 <key(s)> | Line* | char* |restore| line *|
          +-------+-------+-------+-------+
 All (+)  |  "1"  |  "2"  |  "3"  |"Enter"|
 commands | Top of|Bottom | Start |       | 
 operate  | page+*|of page|of line| Search|
 from Dot +-------+-------+-------| arg * | BK SP    Go to end of line*
 to Mark  |      "0"      |  "."  |       | DELETE   Delete previous* 
 if Mark  |  Down line*   |Search |       | ESC ESC  Repeat RED cmd*
 is set   |               |again *|       |     
          +-------+-------+-------+-------+ 
 To Exit: ^C  [or] ^Z  Return to TECO           
          ESC ^Z       Exit from TECO           
          ESC - ^Z     Kill output, exit    

You may note differences if you compare this to other flavors of
VTEDIT, owing to the fact that OS/8 VTEDIT is not derived from the
lastest version of VTEDIT.

The next section comes from the authors of the VT52 version of VTEDIT.
The keypad colors it talks about refer to the VT52 keyboard.


# Video Terminal Editor for TECO-8

## Originally written by Herb Jacobs & Mark Bramhall, modified by Jim
Roth & Stan Rabinowitz

This macro provides immediate mode support for the VT52 and VT100
video terminals (updates occur as they are entered).  This macro makes
editing with the VT52 extremely easy and accurate, but will initially
take some editing to get used to.  This macro is very complete and
allows for almost any editing situation.

VTEDIT.TEC resides in q-register I.  It may be loaded by
ERVTEDIT.TEC$YHXIHK$$.  Whenever TECO will accept a command, MI$$ is
used to enter VTEDIT.  A user can automatically cause VTEDIT to be
loaded into Q-register I by putting the appropriate commands into his
initialization file, TECO.INI.

Any characters typed to VTEDIT are immediately put into the text
buffer at the current position of the text pointer, except for
the single character commands described below.  Because the typed
text is immediately displayed in the text buffer VTEDIT stops
terminal echo.

VTEDIT uses all of the numeric Q-registers.  Because of this, users
must not use Q-registers 0-9 while editing with VTEDIT.  The commands
for VTEDIT.TEC are: (named character commands are not on the keypad)

Keypad      Teco
Character   equivalent  Description

  ->        C           Move text pointer forward 1 character
  <-        R           Move text pointer backward 1 character
  0         L           Move text pointer down 1 line
  1         0J          Move text pointer to begining of text
  2         ZJ          Move text pointer to end of text
  3         0L          Move text pointer to begining of current line
  4         -L          Move text pointer up 1 line
  5         D           Delete 1 character following the text pointer
  6                     Deletes string most recently found via a
                        search, search again, cut, or paste operation
  7                     Insert 1 blank line and position before it;
                        esthetically pleasing for inserting text lines
  8         P           Perform 1 page command
  9                     Read the next input character literally, not
                        as a command
  Delete    -D          Delete 1 previous character
  Backspace L2R         Position text pointer at the end of the line
  Control-U 0K          Delete the text from the begining of the line
                        to the text pointer
  Control-K K           Delete the text from the text pointer to the
                        end of the line.
  Control-D             Removes the text from the text pointer to the
                        end of the line.
  Control-C             Exit from this macro to normal TECO mode
                        The macro is started again by MI$$
  Control-Z             Same as Control-C
  ENTER                 Accept a new search argument to be used in
                        conjunction with the keypad '.' key. This
                        argument may be edited with DELETE and Ctrl-U
                        and is terminated with the keypad '.' key (or
                        $$) which performs the search.
                        The search string may not end with an altmode,
                        but may have embedded altmodes.
  .                     Search for next occurence of ENTERed argument
                        If search fails, text pointer is moved to top
                        of page
  ^(uparrow)            Move the text pointer up 1 line to the same
                        column
  v(downarrow)          Move the text pointer down 1 line to the same
                        column
  blue key              Save 1 line of text for moving, each successive
                        key strike adds another line to the movable
                        portion; the first line saved is from the
                        cursor to the end of line
  grey key              Retrieve saved text (from blue key) at current
                        text pointer position
  red key               Enter extended command mode

Extended command mode allows any TECO command to be executed directly
while remaining in VTEDIT.  The text buffer is not affected except as
the possible result of the executed TECO command.  The TECO command to
be executed is displayed at the top of the VTEDIT screen and allowed to
be edited with the following commands:

Control-U       Abort extended command mode, return to normal
                insert mode. Nothing is executed.
Delete          Delete previous character entered.
Escape Escape   Execute the command just typed and then return
                to normal insert mode.  Commands are executed with
                the text pointer at its last position in normal
                insert mode.  If the command causes an error, VTEDIT
                has to be continued by executing  MI$$ .  Executing
                another macro is O.K. as long as it doesn't destroy
                any of the numeric Q-registers.


A numeric argument (of the form ESC number) may precede the following
commands:

Paste, open line, page, quote, up, down, left, right, up line, down
line, delete char, search.

This argument makes the obvious modification to the command.

The "up line" and "down line" keys (keypad keys 4 and 0 respectively)
are much faster than the "up in column" and "down in column" keys
(up-arrow and down-arrow keys).  Consequently, when scanning through
a portion of a file, the "up line" and "down line" functions are
preferred.

Note that TECO maintains a type-ahead buffer. It is possible for you
to type faster than VTEDIT can update the screen.  In such a case,
VTEDIT will not lose your type-in, however, it will stop updating the
screen (to save time) until it has finished processing all the commands
that you have typed in.
