The Birth of vi
lanc writes "Bill Joy, co-founder of Sun, tells the story of how he wrote the vi editor. The article at The Register delves into his motives, who instigated the project, and some of the quirks of leaving a 'gift to mankind'. From the piece: '9600 baud is faster than you can read. 1200 baud is way slower. So the editor was optimized so that you could edit and feel productive when it was painting slower than you could think. Now that computers are so much faster than you can think, nobody understands this anymore. The people doing Emacs were sitting in labs at MIT with what were essentially fibre-channel links to the host, in contemporary terms. They were working on a PDP-10, which was a huge machine by comparison, with infinitely fast screens. So they could have funny commands with the screen shimmering and all that, and meanwhile, I'm sitting at home in sort of World War II surplus housing at Berkeley with a modem and a terminal that can just barely get the cursor off the bottom line.'"
(I'm using Emacs, BTW.)
I think in vi. When editing, commands just happen like thoughts. They are so ingrained in my brain I don't even remember the actual key sequences. When a vi newbie asks, "how do you do XYZ in vi?," I have to stop and think hard, because I don't even know the commands any more.
Vi is the ultimate editor, for one main reason. It's a modal editor, so commands can be mnemonic. With editors like emacs, you're always having to hit ^X before commands, or with MS word you're always having to lift your hand off the keyboard to move the silly mouse around. With vi, you don't need a steenking mouse. Your hands never leave the keyboard. And commands make sense and don't require that you hit some yucky control sequence to initiate.
I love my vi.
> It was a world that is now extinct. People don't know that vi was written for a world that doesn't exist anymore
I use vi everyday but i've long stopped recommending it to most people i introduce to linux.
it really doesn't seem worth steep learning curve for most people.
Do you recommend vi to all new *nix users now?
The legacy of how vi was written is pretty much evident in the terse commands it uses - commands are short, to the point but an absolute bitch to figure out without some reference. However, the short commands are still useful in today's gigabit ethernet world with Gigahertz CPUs - the short commands are quicker to type and for plain text, I'm much faster with vi than any other text editor around.
This is good history to remember. Those who weren't there find it hard to appreciate the tremendous leap forward of Unix Version 6 and ed on a PDP-11. We had been using teco on our PDP-10 and the cousin of ed that was on Multics, but we had been getting into PDP-11s for more and more things. Comparing ed on Unix with the line editors available on PDP-11 DOS/BATCH and that new-fangeled RT-11 thing was amazing. Along with all the other tools available on Unix, the PDP-11 went from a toy to a state-of-the-art (for then) development environment. We were mostly on DECwriters and TI-Silent 700s runing hardwired 1200 baud at work and 300 baud from home over the modems. We started to get VT-100s about the time vi was being released and it was again a great leap forward.
Thanks Bill Joy! I have used your work in the BSDs and Suns and all the followons over the years, but vi was a most important gift at an important time.
The time for dual-mode editors (where you have to press something before you can begin to type, and then press something else when you stop typing) is long since gone, thank goddess.
(ay)
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
vi was a horror when I started using UNIX systems and I couldn't understand why anyone would want to use such a strange editor. So I went with emacs and was happy. But after a while (dunno how this happened) I went back to vi(m) and invested the necessary time to learn it. I took me about a year before I could say that I'm able to use it efficiently, so the learning curve is pretty heavy. But at the end I don't regret it at all, because I feel a lot more efficient with vi(m) than with any other editor. I couldn't live without it now.
Good tools are hard to master.
The article has definately triggered some nostalgic moments, but it's an article from September 2003 that reports on the content of an interview conducted in 1999. It isn't really news any longer.
Yeah, ed is the best!
"When I use an editor, I don't want eight extra KILOBYTES of worthless
help screens and cursor positioning code! I just want an EDitor!!
Not a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED!
ED! ED IS THE STANDARD!!!"
I use vi (actually, vim) all the time. Many people do. It is a *good* well featured editor which doesn't take up too much space. It runs on all the operating systems I use every day - OpenBSD, Linux, Macintosh and Windows. If I have a GUI, I use the GUI version. If I don't, I use the terminal version. It is consistent across all those four operating systems I mention regardless of whether I'm using it via the GUI or over an ssh terminal session. That consistency is worth _a lot_. It doesn't need the mouse either which makes it much faster to use. Vi is just as relevant today as it was back when it was written, possibly more so because of its consistency across systems.
Oolite: Elite-like game. For Mac, Linux and Windows
modal editors is the worst idea in the history of computing.
Insert mode. Overtype mode. That's modal. I suppose you're against that.
I still use vim as my primary text editor, on Linux and Windows. It's just a neat little text editor; it does everything I want it to do and it does it efficiently. Plus I've been using it for years, so I'm comoftable with it. I see no reason to stop using it.
I may have switched to using things like Eclipse for editing specific types of text file (Java, PHP, HTML and XML) and using Visual Studio for coding (because nowdays I'm primarily working on Windows), but vim is still my utility text editor when I want to quickly modify or look at a text file.
I daresay a lot of people feel the same way about emacs; frankly they're entitled to.
Yeah, I had a sig once; I got bored of it.
I haven't found vi or emacs to be hard enough.
That why I port edlin to every box I work on.
"The price good men pay for indifference to public affairs is to be ruled by evil men." ~Plato (427-347 BC)
"My PID is Inigo Montoya. You kill -9 my parent process, prepare to vi. "
modded down in three, two...
There is no sanctuary. There is no sanctuary. SHUT UP! There is no shut up. There is no shut up.
All code that doesn't fit an 80 column terminal was written by failures.
here
I see so-called "hardcore" Unix geeks advocating 'ed'. Nonsense! The ultimate Unix editor is "cat >filename". All the others are for indecisive wimps who don't know what they're going to write, or incompetent losers who make mistakes.
:w saves!
I actually want that on a t-shirt. I would do it myself, but I don't think my stenciling skills are up to the task.
nstresting comment!:wq
Modal editors are a bad idea, but the thing is, most people don't actually want an editor. Most of the time, they want an electronic typewriter. Entering text and editing text are two conceptually separate tasks, and this is why vi works as an exception to the rule 'modal user interfaces are bad.' Vi is really two separate applications; one for entering text, and one for editing text. Because you often want to do these in quick succession, it allows you to quickly switch between them.
I am TheRaven on Soylent News
You mean libgpmg1. That's not related to GTK in any way (thank god).
Personally, I am happy with nvi(1), "a 'bug-for-bug compatible' clone of the original BSD vi". No strange dependencies there. But then I use emacs for all longer editing sessions.
When I was young and foolish I used notepad.
When I was forced to learn unix, I chose pico.
When I learned more about the GPL and linux I chose nano (a whole three orders of magnitude better).
When I figured out that most of the physics and astronomy I do involves coding, I tried Emacs.
When I found machines that didn't have Emacs or a network connection, I was shocked and horrified
(these are remarkably common in the astronomy world though you wish they weren't)
With no other recourse, I forced myself to learn vi(m). The vimtutor and docs were my friend.
Now I do not need them. I learned the keys. Then I forgot them. My fingers remember though...
J'y suis, j'y reste.
Reality must take precedence over public relations, for nature cannot be fooled.
I remember once getting really fooled by this. I'd accidently created a file with two sequential copies of the text I thought I had. I searched for "foobar", which worked as expected; then I searched again. The screen didn't change, and the cursor didn't move. So, first I checked if the mainframe had crashed, but that wasn't it. It took many minutes of fooling around to realize what had happened: EMACS had figured out that the screen already looked right, so no need to do anything (except perhaps update a character or two on the status line). I wonder how many other people had similar experiences back in the day.
So, sure EMACS may have been too big to run fast on Bill's machine, but bandwidth to the terminal had nothing to do with it.
Long before Bill Joy, UNIX had a good full-screen editor - the RAND editor. The RAND editor dated from the early 1970s. I used it at Ford Aerospace, and it was much nicer than "vi". But it wasn't free. You had to pay RAND for each copy.
The RAND editor was much closer to "what you see is what you get" than "vi". It was a full-screen editor with all the commands on function keys. All the keys like "insert", "delete", etc. did what you'd expect. Labels were provided to show what each function key did. So it was far more user-friendly than "vi".
The RAND editor was modestly portable from terminal to terminal. It worked best on HP terminals of the period, and was table driven so that it could support different devices. But you had to change the tables in C and rebuild to add support for a new device.
The RAND editor had fewer "mode" issues than "vi". What you typed went in at the cursor position. For a few special commands, like "find", a special line at the bottom of the screen was used. But you could always see visually what was going on. Much better look and feel than "vi".
Those of us who had both available used the RAND editor.
Some of what Joy is credited for in the early days of UNIX reflects the fact that he worked for a tax-funded organization working under a contract that allowed them to give software away.
Up until recently I worked at Borland. My whole team was informed by teleconference that our work was offshored. Anyway, I used Brief in the 90s at other jobs, both before and after Borland bought it. So naturally, I assumed it would be easy to get a copy of Brief to do my development, given that my employer owns the program. Sorry, the help desk doesn't know anything about Brief and can't help you. So, I stared googling for a bootleg copy, from my Borland workstation, of Borland software.
Any wonder Borland is about to go bankrupt?
Naw, man, sed is way better than ed!
Real geeks use an editor that doesn't display anything at all. And with sed, I can screw up all the files in a directory at once, instead of one at a time with ed.
That's all I have to say, but I think it had to be sed.
(T>t && O(n)--) == sqrt(666)
One can edit in VI very efficiently without moving the keys from the home position, and doing unnatural stretches for odd keys.
Love many, trust a few, do harm to none.