Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : QWHITE13.ZIP
Filename : VI.TEC

 
Output of file : VI.TEC contained in archive : QWHITE13.ZIP

ID:VI Using VI
Quarterdeck Technical Note #245 Filename: VI.TEC
by James Belden CompuServe: VI.TEC
Last revised: 6/30/92 Category: SW3

Subject: Basic commands of the UNIX vi text editor, which may be used to set
up DESQview/X-related files on UNIX machines.


GETTING STARTED WITH VI

'VI' is a screen oriented editor developed by Bill Joy for all UNIX systems.
It is a powerful, portable, and somewhat learner-hostile editor found on most
UNIX systems today. This document is not meant as a full blown tutorial but
can be used as a quick introduction/reference so that you can do some basic
editing using VI. If you would like to learn more about VI and its numerous
options and features, there are several books on the subject including the MAN
pages and the manuals that came with the UNIX operating system you are using.

Starting VI:

VI
or
VI filename

'VI' has two basic 'modes':

Command VI interprets keystrokes as commands
Input VI accepts keystrokes as data

Essential commands:

NOTE: All VI commands are case-sensitive.

Cursor Movement Screen Control
--------------- --------------
l one space to the right CTRL-f next screen
h one space to the left CTRL-b previous screen
j one line down CTRL-d scroll forward
k one line up CTRL-u scroll backward
$ end of a line CTRL-l redraw screen
^ start of a line
w next word
e end of a word

Entering Input Mode Making Changes
------------------- --------------
i insert before cursor cw change word
a insert after cursor cc change line
I insert at beginning of line C to end of line
A insert at end of line r character at cursor
O open and insert in line above
o open and insert in line below

Making Deletions When in Insert Mode
---------------- -------------------
dw delete word BACKSPACE delete character
dd delete line CTRL-w delete word
D delete to end of line ESC return to command
x character at cursor mode

Misc. Functions Last Line Mode
--------------- ---------------
u undo :w write file
/ search forward :q quit
? search backward :wq write and quit
n next occurance :n next file
. repeat last action :r read in a file
Y Yank a line :e edit a file
p put below :f file name
P put above :set change options
ZZ write to file and quit :! shell escape
ESC cancel command :num line num = the
line number
:q! quit editing, don't
save changes

This should be enough for simple editing. For further instruction and
information consult the manuals that came with your system or find one of the
many good books on UNIX that will discuss the topic further.

************************************************************************
*This technical note may be copied and distributed freely as long as it*
*is distributed in its entirety and it is not distributed for profit. *
* Copyright (C) 1991-2 by Quarterdeck Office Systems *
************************ E N D O F F I L E *************************