Getting Started with vi

by Donald Hyatt

What is vi?

The fundamental UNIX editor is called vi. It is a primitive editor, but it will be found on every UNIX system, and works well when logging in remotely from home. There are just a few commands that one needs to learn at first, and they will be sufficient to write simple files. For more advanced features, consult some of the handouts and books available in the CS lab.

The Basics of vi

There are essentially three Modes in vi, the Insert Mode where one is typing in new text, the Edit Mode where one is modifying text that is already there, and the Command Mode where one is interacting with the operating system with actions like reading and writing files.

Most of the commands require just a simple letter or two, but be careful to note that vi is case sensitive, and capital letters do different things from lower case letters. It is not necessary to learn all of these commands, but eventually they will become second nature. The basic operations needed to create a file are related to each of those modes, so let's look at them separately.