In the land of Unix, vi is a native and Emacs is an alien. Whether it's an alien from space or an alien from a foreign country depends on how I'm feeling at the time, but it isn't from around here.

vi stands for 'visual interface'. It's a visual interface to ex, a Unix text editor developed by Bill Joy and others around 1976 as a line editor that grew out of constant hacking on ed, the line editor created by Ken Thompson around 1970 for the original Unix system. vi came soon after ex, and was also in use in 1976.

Emacs ('Editor MACros') was originally written around 1975 by Richard Stallman and many others in the command language of a text editor for ITS called TECO (Text Editor and COrrector, originally Tape Editor and COrrector because it was first designed to edit files stored on paper tape). ITS stood for 'Incompatible Timesharing System', and it was even stranger than that. The command line in ITS was a machine code debugger like MS-DOS's debug.com could only dream of being. The most important thing about ITS, however, was that it was a child of wealth: MIT officially sanctioned it, as bizarre as it was, and gave the people using it high-end computers that could run an interactive full-screen text editor written in a high-level language without bogging down completely.

ed, on the other hand, was a child of poverty. The original Unix was a very much unsanctioned (or semi-sanctioned) use of an obsolete PDP-7 that Bell Telephone Labs (now Lucent) happened to have kicking around in a closet. Even after Unix was ported to more modern hardware it still had to deal with people using it from teletypes, which are typewriters that somehow learned to talk on the phone through a modem. There is absolutely no way to use a full-screen editor on a teletype, so ed was designed to let people edit files line by line. By the time vi was developed teletypes were dead, but Unix systems were still relatively underpowered. Writing an editor in a high-level language simply wouldn't have worked.

In 1978, Bernard Greenberg wrote an Emacs clone for an OS called Multics. It's so important because it was written in Lisp, a programming language that escaped from a mathematician's equations. Lisp was the ultimate high-level language back then, as it had been since 1958 and as it still is (along with others). Writing Emacs in Lisp meant that people could modify Emacs in Lisp, and write extensions to Emacs in Lisp. Lisp, in turn, could be modified in ways to make writing Emacs easier, as all Lisp programs are at least partially an exercise in language-building. Modern Emacs had been born. By the 1980s, both ITS and Multics were effectively dead. The people who worked on them went elsewhere, mostly to Unix, and in 1984 Richard Stallman created GNU Emacs partly to further his political goals but mainly to ensure Emacs, his only begotten son, would survive the destruction of his homeworld.

Lisp programs usually like to stay within the Lisp universe, creating an ethnic neighborhood that hangs together extremely well but doesn't quite mix with the outside city. Some, like GNU Emacs, grow so self-contained they resemble operating systems. People create within Emacs an environment where they can share information freely between programs (called 'modes' in GNU Emacs) and rely on a number of memorized keystrokes and tactics to efficiently rule the universe. That is the glory of Emacs.

vi is only one part of an entire operating system, usually one called 'Unix' or 'Linux' or something similar. It mixes well with the Unix natives like sed and ls and grep. It shares information freely using pipes and temporary files the way all other Unix programs do. People who understand and enjoy the command line use vi as one part of the larger command line universe. That is the glory of vi.

http://web.cecs.pdx.edu/~kirkenda/joy84.html -- Interview with Bill Joy about the history of vi. It contains this interesting quote from Joy:

But fundamentally, vi is still ed inside. You can't really fool it. Its like one of those pinatas - things that have candy inside but has layer after layer of paper mache on top.

This is how a lot of Unix programs are created: There is a core engine (usually written in C) that does all the hard work with algorithms and brutal speed hacks. Layered on top of that is the interface, something to make it pretty and usable. In Emacs, on the other hand, the only thing written in C is a Lisp compiler/bytecode interpreter. All of the 'editor' stuff is in Emacs Lisp.

http://www.english.uga.edu/hc/unixhistory.html -- A very brief history of early Unix.

http://c2.com/cgi/wiki?EmacsIsSuperman -- A story on the original wiki revealing the true origin of Emacs.