home *** CD-ROM | disk | FTP | other *** search
-
- 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 it's 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 inputs keystrokes as data
-
- Essential commands:
-
- 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/
- 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.
-
-