Vi Editor, A Less Beginner's Guide

Why Vi Is More Useful And Maybe Faster Than Edlin Or Emacs

by Rickard Andersson (rickard@softlab.se)
written 18 Nov 1994

This article is classified "Real"


Here is the sequel to the Vi Editor, A Beginner's Guide article, which
explained some of the basic facts about the all-to-famous text editor vi.
This article contains more or less everything that was left out from the
first article.  My advice for those that haven't read the first article is
to promptly read this article and then look up and read the first article.
Expert users of vi can skip both these introductionary articles and go
straight to more expert-friendly articles about vi.  If you can't find any
other vi articles than the ones you have read already, a good explanation
will be found in the next sentence.  Writing and updating articles for the
PGG are done solely for fun and in spare time.

There are some different implementations of vi for different computers, in
some cases there are even different implementations for one particular
computer.  One good example of a good implementation of vi for a good
computer is VIM for the Macintosh computers.  VIM is also available for use
on Amiga DOS, (Archimedes), MS-DOS, Windows NT and many Unix versions.  VIM
has all the basic vi features and many new and interesting features,
including multiple open windows.

But enough of the introduction speech; here are many goodies for all the
less beginner's of the vi text editor:

          * To move one line down, press the [j], [<return>], [^G], or
            [+] key.

          * Press the [%] key to find next bracket and go to its match.
            This also applies to [, ], {, }.

          * To set a mark on the cursor position, just press the [m] key +
            [one letter].

          * To move to a mark, press the [`] key + [one letter].

          * Press the [:] key to switch to the command line.

          * On the command line, press [p], [r], [e] and [return].
            This makes vi preserve the text file by saving the buffer as
            if the system has crashed.  Recover with 'vi -r' command.

          * Press [^G] to see file information.
            File name, status, current line number and position.

This was some advises and tips on how to get the more out of vi.  Two useful
features in vi that haven't been mentioned yet, are macros and abbreviations.
They will be explained in the forthcoming sequel Vi Editor, A Expert
Beginner's Guide.

See also:
  • Vi Editor, A Beginner's Guide
  • Unix Vi Editor, Case Study Of

  • Go to [Root page | Title list | Author list | Date list | Index]