Introduction to Systems Programming
Introduction to the
In many systems, the original
vi editor has been
replaced by the
vim editor. Usually there won't
be a noticeable difference until you need to undo something.
There are two easy ways to get started. Both require running
the editor while you learn, and will take about 30 minutes.
- Log into a Unix, Linux or Mac OS X system, open a terminal
window, run the command
follow the instructions. The information is accumulated in
- vi intro -
the cheat sheet method, Daniel Robbins, Gentoo
Linux. This demonstrates
- The same thing, but the
older IBM version, in PDF format.
- There are a few places where you need to carefully
distinguish the period ending the sentence from a character
that you type, and distinguish the numeral
l. The notation
the same thing. In the first part of the cheat sheet, /
just means "or"; later it will be a command.
- If you want to create a file
without first using an editor, just to get started, try this
date > myfile.txt
For more lines, try
date >> myfile.txt
Note that the
.txt suffix is just a suggestive
part of the file name, and does not convey any particular
meaning to the OS. Unix does not require filename
suffixes as Windows requires them.
Tutorial, for a different approach and some very nice
- Note that keyboard layout on the Cheat Sheet is (almost)
for a typical PC, which differs from the Sun keyboards in the
For more information about
- You can do useful work with only a few editor commands, but
vim have a lot of features that can make your
editing time more productive. Plan to revisit the
tutorials to refresh or expand your knowledge.
For more information about
vi in general,
These are recommended after you have been using
vim for a while,
If you need an actual book,
Various comments and opinions - it takes a while for
some people to warm up to
- Harley Hahn's Guide to Unix
and Linux, McGraw-Hill, 2009. Chapter 22, The
Text Editor. This is really good.
- Arnold Robbins, Elbert Hannah, Linda Lamb,
Learning the vi and Vim Editors, O'Reilly,
seventh ed., 2008.
first vi session
- The original posting disappeared from the Web. This
version is from the author of GNU's Guided Tour of Emacs.
Word for source code
- Warning: this links to The Daily WTF. That site is
- Harley Hahn wrote another book many years ago, with a chapter
vi and a chapter on
The first one started, "If you think
vi is bad,
emacs." The second one started, "If you
emacs is bad, try
still haven't decided if that was meant as advice, commentary,
or warning. Anyway, he dropped the
chapter. Now he just says (p. 315), "while
is difficult to learn, Emacs is very difficult to learn." Just because
something is difficult to learn doesn't mean it isn't worth the
effort. Anyway, I don't think it's difficult to learn,
unless you try to learn all of it at once.
Last revised, 17 Jan. 2013