The vi editor

Last edited

vi is perhaps the most commonly used editor, certainly in the world of Linux and *BSD. Because it is such an awesome piece of software, we build this fan page.

The vi editor is our favorite editor. vi truly enhances your productivity.

Some background on vi

Bill Joy gave the world the blessing of a very great editor, called vi. This is what Bill said in an interview:

So I had a terminal at home and a 300 baud modem so the cursor could move around and I just stayed up all night for a few months and wrote vi. (...) It was really hard to do because you've got to remember that I was trying to make it usable over a 300 baud modem.

Bill build vi a long time ago (like: 30 years). But still vi is one of the most used editors. vi is very powerful and we love it.

vi replications

There are many replications of vi: editors that works like vi that are build for some specific operating system or that are build with enhancements. Basically they are all vi. Only sometimes even better.

vi is a great part of a text mode shell server

Should I learn vi?

Definitely! It will not take that long to learn vi and the effort you put in it will be earned back in many years to come!

How to learn vi?

In any decent book about Unix there are one or more chapters on using vi. Even better is the book Learning the vi Editor from O'Reilly. There is also a book purely about vim, that can be downloaded here (pdf, 3.7 Mb).

If you are running Linux or one of the BSD-flavours, it is probably best to first install vim. vim is a very user-friendly vi-clone with a lot of enhancements which is easier to learn then the classic vi. To benefit from this, go to your home-dir and create a .vimrc file first:

cd ~
echo "set nocompatible" > .vimrc
echo "set showmode" >> .vimrc
echo "set ruler" >> .vimrc

This will make vim to act like vim and not like plain vi and also give you a little bit more feedback about what is going on.

Prepare to take a weekend to learn vi. Yes, that is two days. And yes, that sounds a lot only to learn to use a editor. But believe us, you will never regret having invested that time.

hjkl motion keys

There are many vi clones available. Most of them know how top cope with the arrow-keys on the keyboard (left, right, up and down keys). Vi was origanally created with the use of the hjkl motion keys. It is defenitly worth your time to learn how to use the hjkl-keys. It will take some time before the use of these keys is as natural as the use of the arrow keys. But then your efficiency at the keyboard will grow a lot!