1.0 - What is vi?

vi is a Visual Editor (hence the name -- vi for VIsual). What is a visual editor (as opposed to a non-visual one)? Visual editors are ones that let you see the document that you are editing as you edit it. This seems pretty common in most editors today, so the idea of a non-visual editor is a little strange. Examples of non-visual editors are sed, ex, ed, and edlin (the last one being the editor shipped with DOS until relatively recently.)

vi was written by William Joy as part of the bsd distribution of Unix. It was later used by AT&T, and has been standard Unix since.

1.1 - What is the big deal about vi? Why does anyone use it? More importantly, why should *I* use it?

vi is default visual editor under Unix, and is therefore shipped with all recent version of Unix. (Recent being defined as post 1984 or so.) This means that whenever you run across a machine that is running a Unix of some sort, you will know that you have a powerful editor at your finger tips. Why else? vi is a powerful editor. Also, once you know vi, you can edit files really quickly, as it is extremely economical with the keystrokes. Due to its different modes for inserting and issuing commands, it is much faster than most non-mode based editors. It is also a very small editor. (The version on my machine is 200k) Also, it can do almost anything, as long as you know how to get it to do what you want.

1.2 - Wow! This sounds great! Is there any reason not to use vi?

Yes. There is a very good reason. It can be somewhat hard to learn, and until you do so, it will be slow and painful. Once you learn it, it will be faster, but the process of learning it is slow. I've been asked if vi was an easy editor to learn, whether it was intuitive or not. My general response to this question is: "Yes, some of us think so. But most people think that we are crazy."

1.3 - What different operating systems is vi available for?

Unix. That's it. However, there are many, many clones of vi that are available for different operating systems. I personally have used vi clones under: Unix, Dos, OS/2, Mac System 7. (See below for a list of specifics.)

1.4 - Okay, you've convinced me. I'm going to learn vi. Where do I start?

Well... That's a tricky one. There are many good books out there that cover vi; most books on Unix have at least one chapter devoted to it. There are also many books devoted specifically to vi. I don't have any preference, so your best bet might be to ask your local vi guru where they learned. Also, play around. Fire up vi with a non-important document (your dissertation is NOT a good document to learn vi with...) and play around. I can't imagine anyone learning vi without playing around with it quite a bit. Remember, if you get confused, just hit the Escape key a couple of times, and you'll be in command mode again.

I should mention at some point, and I guess here is as good a place as any, that people who think they might want to do Unix system administration, or any type of configuration of unix machines will probably also want to learn ed or ex, as some versions of Unix do not put vi in the root partition, and one might be stranded without it at some point. Ed is a good choice.

1.5 - What are some of the vi clones that are available?

Just to list a few: STvi (STevie), elvis, vile, vim, and nvi, xvi.

elvis is available for: Amiga, DOS, OS/2, Unix, VMS.
STevie is available for: Atari ST, DOS, Unix.
nvi is the vi that will ship with BSD 4.4.
vim is available for: Amiga, DOS, Mac System 7, Unix. Amiga, DOS, and the source are available at:
ftp.fu-berlin.de /misc/editors/vim
vile is available for: DOS, OS/2, Unix, VMS.
xvi is available for: DOS, Unix.

There are some differences between the different vi clones. Many offer improvements, but most still allow the commands that are listed in this document, but there may be some differences. Refer to the documentation that comes with the clone for details.


[Index][next][previous]
This HTML version of the vi Faq was compiled by Baruch Promislow of Macom Networking LTD.

(C)opyright, E. Larry Lidz, 1994, 1995. All Rights Reserved.