Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vi(1) — Unisoft V7

Media Vault

Software Library

Restoration Projects

Artifacts Sought

VI(1)  —  UNIX Programmer’s Manual

NAME

vi − screen oriented (visual) display editor based on ex

SYNOPSIS

vi [ −t tag ] [ −r ] [ +command ] [ −wn ] name ... 

DESCRIPTION

Vi (visual) is a display oriented text editor based on ex(1). Ex and vi run the same code; it is possible to get to the command mode of ex from within vi and vice-versa. 

Vi puts up a screenful of text at a time (unless a smaller window is specified) and allows rapid and fluid cursor motion to the place where you want to begin adding, changing, or deleting text.  With vi, editing can be done on characters, words, lines, or sections at a time.  When multi-character changes are made, it is necessary to hit the ESCAPE key to return to cursor motion mode. 

Using ex commands and calling up the Shell by typing (!) are done with a colon (:) and the appropriate command sequence, such as that to find a string or write the file. 

The "Vi Command Summary" (below), the Vi Quick Reference card and the Introduction to Display Editing with Vi provide full details on using vi. 

The following options are recognized:

−t Equivalent to an initial tag command, editing the file containing the tag and positioning the editor at its definition. 

−r Used in recovering after an editor or system crash, retrieving the last saved version of the named file.  If no file is specified, a list of saved files will be reported. 

+command
indicates that the editor should begin by executing the specified command.  If command is omitted, then it defaults to "$", positioning the editor at the last line of the first file initially.  Other useful commands here are scanning patterns of the form "/pat" or line numbers, e.g. "+100" to start at line 100. 

−wn sets the default window size to n, and is useful in dialups, to start in small windows. 

Name arguments indicate files to be edited. 

VI COMMAND SUMMARY

Cursor Motion:     Forward       Back
---------------    -------       ----
letter            (space)       ^H, h
word right-limit   E,e
word left-limit    w             B,b
sentence           )             (
paragraph          }             {
section/function   ]]            [[
line: same/limit   $             0
      1st charac   +,<ret>       -
      same column  ^n,LF         ^p
      specified    <line#>G     <line#>G
1/2 screenful      ^d            ^u
screenful          ^f            ^b
  Undoing Errors
--------------
       (see also: change, insert, delete)
 u      undo last change
U      restore current line
dp     retrieve dth last delete
<esc>  abandon incomplete command (without completing it)
:q!    drastic!  abandon without saving.
  Insert                   Change                 Delete
------                   ------                 ------
 i  before cursor         cw<newword>     word    x    character
I  before 1st non-blank   C substitute line      X ....before cursor
a  after cursor           s substitute charac.   dw    word
A  at end-of-line         S subst. lines         de ....but leave punctuation
o  open line below       rx replace 1 charac     dd    line
O  open line above        R replace characs    (#)dd   number of lines
<esc> terminates insert  xp transpose charac     D     rest of line
                      <esc> terminates change  <esc>   terminates delete
                                                 Delete during Insert
                                                --------------------
 
                                                last charac    ^H
                                                last word      ^W
                                                all input this line <@>
 

FILES

See ex(1).

SEE ALSO

ex (1), edit (1), "Vi Quick Reference" card, "An Introduction to Display Editing with Vi". 

AUTHOR

William Joy
Mark Horton added macros to visual mode and is maintaining version 3

BUGS

Software tabs using ^T work only immediately after the autoindent. 

Left and right shifts on intelligent terminals don’t make use of insert and delete character operations in the terminal. 

The wrapmargin option can be fooled since it looks at output columns when blanks are typed.  If a long word passes through the margin and onto the next line without a break, then the line won’t be broken. 

Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need help in doing this correctly. 

Saving text on deletes in the named buffers is somewhat inefficient. 

The source command does not work when executed as :source; there is no way to use the :append, :change, and :insert commands, since it is not possible to give more than one line of input to a : escape.  To use these on a :global you must Q to ex command mode, execute them, and then reenter the screen editor with vi or open. 

7th Edition  —  2/2/82

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026