Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Unix Operating Systems Software IT

The Birth of vi 459

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.'"
This discussion has been archived. No new comments can be posted.

The Birth of vi

Comments Filter:
  • by BarneyRubble ( 180091 ) on Saturday January 06, 2007 @07:32AM (#17486788)

    > 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?
  • Speed of vi (Score:5, Interesting)

    by larien ( 5608 ) on Saturday January 06, 2007 @07:33AM (#17486792) Homepage Journal
    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.
  • Re:Too bad vi sucks (Score:2, Interesting)

    by tuxlove ( 316502 ) on Saturday January 06, 2007 @07:45AM (#17486844)
    modal editors is the worst idea in the history of computing. [sic]

    This thinking is precisely why vi continues to be superior to other editors. For some godforsaken reason people seem to be afraid to make modal editors, so "modern" editors damn you to using a mouse or ugly awkward command sequences for everything. Can someone explain why modal editors are a bad thing? It is this very fact that's kept me using vi for decades now.
  • by bl8n8r ( 649187 ) on Saturday January 06, 2007 @08:42AM (#17486984)
    I've been using them since 1993 and have never gotten used to them. I got hooked on the Borland 3.1 IDE and IMHO it was a better text editor. I appreciate the efficiency of nano and others when logged in over a serial line, but I really miss BC. One of the biggest problems has been keyboard sets. A Sun keyboard gives different scan codes than a PC and if the terminal settings don't take this into account, things get wacky. You end up with a complete evolution of keys and combinations in each editor just to cut and paste a line of text *ugh*. Nothing the same between them. Another problem with vi (and maybe others) is their growing dependancies on system libraries. I recently tried and install of vi which complained of a gtk dependancy; sheesh. This one [0] is from an embedded arm system (debian). Why do I need gpm when running vi? All I want is a simple, independant text editor that fits in a small space. The mouse isn't even useful in vi (directly). Another curious feature of these text editors is people seem to fancy themselves l33t h4x0r5 when they master the hjkl keys of vi or other un-intuitive keyboard combinations. People, you've not cracked a Gibson here; it's just a text editor. Go fix Bind, then we'll all be impressed.

    [0] vim.basic: error while loading shared libraries: libgpm.so.1: cannot open shared object file: No such file or directory
  • Re:Too late (Score:3, Interesting)

    by _Shad0w_ ( 127912 ) on Saturday January 06, 2007 @09:27AM (#17487134)

    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.

  • by nizo ( 81281 ) * on Saturday January 06, 2007 @09:41AM (#17487198) Homepage Journal
    Yeah, but which editor did you use to write the code for your editor?
  • by Anonymous Coward on Saturday January 06, 2007 @09:57AM (#17487258)
    Edlin is obviously the best.

    Yeah Edlin [wikipedia.org]'s not bad for a 6 month quick fix in QDOS [wikipedia.org] which is still available as the *same* version in Vista ! Microsoft certainly know how to resell code ;-)

    I miss these old editors which had many uses..... With regards to VI for example my friends and myself used to use it to clear out a.out files under rsh (That's RSH as in Restricted SHell under System 4 [uiuc.edu] and NOT Remote SHell)! Mind you that was before we worked out the far simpler command "time csh" which obviously is just a helpful command to time how long you spent in the CSH shell when you ussed that command to start CSH from the RSH shell.... :) Yes, VI helped many people free themselves of the shackles of certain restrictive shells....
  • by crovira ( 10242 ) on Saturday January 06, 2007 @10:21AM (#17487358) Homepage
    a toggle switch front panel with a STURDY [deposit] switch was enough for me. (God I feel O-L-D!)

    PDP-8s PDP-11s, Interdata 7-32s, Cromemcoes, Keronics (Data General knock offs) all those machines I used to toggle in the IPL boot codes for every morning.
  • by Anonymous Coward on Saturday January 06, 2007 @10:28AM (#17487392)
    like many others you think you're using 'vi', but in fact you're using vim or other crap.

    just google; you'll find that the original vi is free now, and builds fine on linux.
    and there's 'nvi' too, which is also better than vim.

    the only reason why someone would use vim is support for multibyte encodings, double-width
    characters, etc.

    and you could cut & paste a line in vi with ':m+2' eg to move it 2 lines below, or with a
    combination of 'dd' and 'p' or 'P'.

    finally, vi is a terminal editor, not a kernel, and has no fucking idea of the scancodes
    and things like that.
  • Re:Too bad vi sucks (Score:5, Interesting)

    by TheRaven64 ( 641858 ) on Saturday January 06, 2007 @10:33AM (#17487418) Journal
    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.
  • by Sigma 7 ( 266129 ) on Saturday January 06, 2007 @10:41AM (#17487468)
    (if you look "vi" commands they are surprisingly logical compared to "Emacs")


    In most vi implementations, touching the cursor keys has a 50% chance of kicking you out of Insert mode. This appears to be caused by cursor key sequences containing ESC, but seems to happen rather inconsistantly - the same applies to vim when it is in compatability mode. While I strongly think that modern systems should not have potentially ambiguous key-sequences (i.e. cursor keys starting with the ESC key), most applications should at least consider the platform they were designed for.

    When I am using a text editor, I want to minimize keystrokes - having to enter insert mode whenever I change lines will slow me down. The same applies to the legacy "notepad" methood of editing - having to block a line of text to cut-n-paste is a slowdown when C-X should immediatly cut the line being worked on (as done in MSVC 2005.)

    Now bring on the "car" analogies. Please no "edlin" since you should be marked as "funny" or "troll"!


    The best editor is a hot-rod. Nuff said.
  • by jgrahn ( 181062 ) on Saturday January 06, 2007 @10:50AM (#17487544)
    Another problem with vi (and maybe others) is their growing dependancies on system libraries. I recently tried and install of vi which complained of a gtk dependancy; sheesh. This one [0] is from an embedded arm system (debian). Why do I need gpm when running vi?

    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.

  • Old networks (Score:3, Interesting)

    by Mostly a lurker ( 634878 ) on Saturday January 06, 2007 @10:54AM (#17487568)
    '... 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 feel his pain. I can remember, even in the early 1980's, travelling around Europe in a support role with an acoustic coupler (300 bps, sometimes less depending on line quality) to talk back to head office. Those who have never done it cannot imagine what 3270 eumulation across a line at this speed is like. Watching grass grow is exciting in comparison. It did have occasional advantages though: if you mess up the programming of your 3270 data streams, debugging by watching the data slowly paint on your screen is surprisingly useful!
  • my story (Score:3, Interesting)

    by gsn ( 989808 ) on Saturday January 06, 2007 @10:55AM (#17487578)
    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.
  • by Cheapy ( 809643 ) on Saturday January 06, 2007 @12:16PM (#17488208)
    A screwdriver isn't hard to master, and that's a pretty damn good tool if you ask me.
  • by billcopc ( 196330 ) <vrillco@yahoo.com> on Saturday January 06, 2007 @12:23PM (#17488266) Homepage
    Ok here goes nothing. I'm a DOS veteran, and I treated my DOS like most people treat their Linux, using extensive modifications and addons to improve usability and productivity. Way back there was Edlin, which even in 1984 felt really ghetto. Its saving grace was that it could be easily scripted for batch usage. Some people used Wordstar, but I personally couldn't stand it. Sure enough, I trivially coded my own full-screen editor in BASIC, and all was well. Then came MS-DOS 5.0, with its flashy Dos Shell and Edit.com, which was really just QBasic minus the Basic part. It worked, it had a cutesy little drop-down menu like Windows apps did, and its usage was obvious to even the most ignorant of users.

    So then one day I get my hands on Slack 2.0. BLECH! Where's the simple full-screen editor I've grown so fond of over the past decade ? :P vi didn't make any sense to me, and Emacs seemed like a huge mess of plugins that ate up more disk space than the OS itself. Now I'm obviously lacking in history when it comes to the Linux/Unix world, but why the hell do so few apps make use of the Function keys ? It's always Ctrl-something.. I'm fine with Ctrl-X and whatnot because they're where my hands would sit, but how hard would it be to just alias F1 to Help, F2 to Save, F3 to Open, in addition to the classic shortcuts.. It would certainly make it much easier to teach.

    And then there's the matter of arrow keys... sometimes they work, sometimes they don't. Ctrk-V or Y for pageup-pagedown, and something else for top/bottom. Now I agree that Unix came first and those shortcuts were probably in use way before Dos ever came along, but why hasn't anyone taken the liberty of adding the "idiot" shortcuts so that Joe Random Switcher can actually try Linux without spending 3 days in complete darkness trying to get a friggin cursor to move ? It's not like those movement keys have anything better to do, most of the time they just spew meta-characters like ^Q^1 or whatever.

    If a text editor does anything more complicated than receive text input and save it to disk, it's no longer an editor in my book. Type setting ? it's a word processor. Syntax highlighting ? it's a development environment. Kinky macro processing and pseudo-hypertext Info-page fornication ? it's a dirty old man's poor excuse for an OS. I'm talking about you, Mr Stallman.

  • by 1u3hr ( 530656 ) on Saturday January 06, 2007 @12:53PM (#17488600)
    Um...why would you learn any of those? At all?

    When your GUI is broken, either through driver problems, pathetic network speed or any other reason.

    Anyway, I personally learnt vi in 1978, when it was a privilege to be allowed to use a screen editor, as opposed to a line editor (ed). That was after spending a year programming using punch card input. Anyway, you can find a cheat card to remind you of the basic commands, and the real power is in regular expressions, which are useful in many other contexts, perl hacking for a start. Even MS Word has a bastardised form.

  • by Animats ( 122034 ) on Saturday January 06, 2007 @01:25PM (#17488900) Homepage

    Long before Bill Joy, UNIX had a good full-screen editor - the RAND editor [rand.org]. The RAND editor dated from the early 1970s. [faqs.org] 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.

  • by brocktune ( 512373 ) on Saturday January 06, 2007 @01:27PM (#17488924) Homepage
    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?
  • by Anonymous Coward on Saturday January 06, 2007 @01:50PM (#17489132)
    Where do you even find the original vi?

    The Unix Heritage Society has the original source code [tuhs.org]. Get the file 2bsd.tar.gz . It's a beautiful tarball. The timestamps in it go back to May 1979! Vi is located in the src/ex directory. This source code might be hard to compile, but Gunnar Ritter has added the needed changes to make it run on Linux. Try http://ex-vi.sourceforge.net/ [sourceforge.net]
  • by mad.frog ( 525085 ) <{steven} {at} {crinklink.com}> on Saturday January 06, 2007 @03:21PM (#17490018)
    Because they're faster. Just like it's faster to use Control+S to save a document than it is to use the mouse to open the file menu, position the pointer over the save entry and press the button.

    http://www.asktog.com/TOI/toi06KeyboardVMouse1.htm l [asktog.com]

    We've done a cool $50 million of R & D on the Apple Human Interface. We discovered, among other things, two pertinent facts:

            * Test subjects consistently report that keyboarding is faster than mousing.
            * The stopwatch consistently proves mousing is faster than keyboarding.

    This contradiction between user-experience and reality apparently forms the basis for many user/developers' belief that the keyboard is faster.

Your computer account is overdrawn. Please reauthorize.

Working...