The original vi is a product of its time (and its time has passed)

40 points by seb 20 hours ago on lobsters | 24 comments

bondolo | 18 hours ago

Bill Joy doesn’t use vi either. When I worked with him in 2001 he was doing all his text editing in windows notepad and Thunderbird. Admittedly he was not writing code at the time, but it was still a bit depressing for a geek to see someone of his background running a Sony Vaio laptop with freaking Windows ME… at Sun… Now, decades later, Bill’s choices seem perfectly reasonable to me; I am much more indifferent to technology choices than I was then. A few years ago I heard he was doing IoT stuff for his boat and he was using the Arduino IDE.

vi and emacs were built for a different age with different problems. There is no reason to continue to insist on using the same solution forever except for attachment to the familiar and unwillingness to change. I use whatever tooling is typical for the project, platform or team. I still make choices and work to influence the direction when I have a useful suggestion to offer. In part the diversity of my experience means that I do usually have something useful to say about how to build software rather than being one of the cretins smugly declaring themselves as a vi user who will die before they change and have utter contempt for anyone who isn’t as “hardcore” as them.

calvin | 16 hours ago

Bill Joy doesn’t use vi either. When I worked with him in 2001 he was doing all his text editing in windows notepad and Thunderbird. Admittedly he was not writing code at the time, but it was still a bit depressing for a geek to see someone of his background running a Sony Vaio laptop with freaking Windows ME… at Sun… Now, decades later, Bill’s choices seem perfectly reasonable to me; I am much more indifferent to technology choices than I was then. A few years ago I heard he was doing IoT stuff for his boat and he was using the Arduino IDE.

Correct me if I'm wrong, but I seem to remember the Plan 9 mailing list was miffed dmr was using Outlook to post once. He was using Windows at the time (albeit with a drawterm to a cpu server, which did have mail there), so...

hugoarnal | 14 hours ago

He was using Windows at the time

Wow this is such a cool article, never seen it before! Thanks for sharing this and it’s so cool that many of them even responded.

gcupc | 6 hours ago

On the other hand, (GNU) Emacs has aged very gently. It looks a bit odd, and some of its names for things and default keybindings are quite idiosyncratic, but its design has meant that all of the experiments in editing over the years (like multiple cursors and LSPs) could be added and tried out without any core redesigns to accommodate them.

ianloic | 5 hours ago

It doesn't hurt that Emacs keybindings became quite standard, from UNIX shells to NeXTStep (now macOS) UI.

POSIX requires vi mode command line editing in the shell, but not emacs mode! I was surprised to learn about vi mode command line editing when I got my Apache commit bit and first logged in, only to discover that bash didn’t work as I expected – and it wasn’t csh which would have been normal on FreeBSD. That was an eccentric box: it also hosted hyperreal.org.

landon | 11 hours ago

I tried opening this in Firefox on android reader mode and got an anti-crawling page. Too close to bed time to read a light bulb :/

ianloic | 15 hours ago

The genuine version of vi I used on IRIX in the late 90s had a tendency to segfault when you opened files with long lines. At the time I was a fairly stalwart fan of nvi. vim seemed like pointless bloat. vi macros were good enough scripting and syntax highlighting seemed like a distraction.

Anyway, I was mostly wrong about that, but I was only a couple of years out from doing most of my programming on a 16Mb Sun3 that usually had half a dozen other active users on it at any time, so my standards were skewed.

fedemp | 7 hours ago

I agree (too) with the sentiment. This is something I hope I will write down eventually: defaults should be good enough. Classic vi being the default $EDITOR is a terrible disservice for those that have to use the terminal once in their time; nano makes more sense, and Fedora did the right thing to set it as the default.

Vim is already 35 years old. Besides being a product of its own time it was also what it was. It's not like there is unlimited time and resources to do everyone anything we could want. Anyone here from that time? Was vim met with resistance and skepticism from vi users when it was released? Or was it mostly welcome as something that people wanted but hadn't implemented it yet?

Syntax highlight is still a divisive impactful feature. Ty opening a gigabyte size file with syntax highlight on and see what happens. So in that sense it departs away from what one expects from vi.

On disk footprint is another one. The Complete vim installation in most linux distributions is 30+ megabytes. This is not appropriate for plug computers and other embedded or small devices.

That said, as the post points out... vi is way too limited for what we can have today even with limited resources. Ubuntu has vim-tiny package which is 1MB. I think this is a no brainer.

ryan-duve | 20 hours ago

It just occurs to me I've never questioned why vi isn't updated like other applications. Even if Bill Joy doesn't personally want to own it, why hasn't the torched been passed down to another maintainer to add features? It feels like it's stuck in time forever.

There’s a story Bill Joy told in an interview in 1984 about why he stopped working on vi

I wish we hadn't used all the keys on the keyboard. I think one of the interesting things is that vi is really a mode-based editor. I think as mode-based editors go, it pretty good. One of the good things about EMACS, though, is its programmability and the modelessness. Those are two ideas which never occurred to me. I also wasn't very good at optimizing code when I wrote vi. I think the redisplay module of the editor is almost intractable. It does a really good job for what it does, but when you're writing programs as you're learning... That's why I stopped working on it.

What actually happened was that I was in the process of adding multiwindows to vi when we installed our VAX, which would have been in December of '78. We didn't have any backups and the tape drive broke. I continued to work even without being able to do backups. And then the source code got scrunched and I didn't have a complete listing. I had almost rewritten all of the display code for windows, and that was when I gave up. After that, I went back to the previous version and just documented the code, finished the manual and closed it off. If that scrunch had not happened, vi would have multiple windows, and I might have put in some programmability - but I don't know.

After Bill Joy there have been Heirloom vi, stevie, vim, elvis, nvi, neovim, etc usw, which is where all the feature development happened.

alurm | 15 hours ago

there is so much stuff out there that says to use 'vi'

Is that true? I'm not sure if I can recall an example I'm sure about.

gerikson | 15 hours ago

I'm an emacs user and I have very hazy ideas about the nuances of vi vs vim vs nvi. I definitely believe the term "vi" is a generic one for "the modeless editor installed on Linux".

And on Emacs, it's it's evil-mode, not eviml or envil mode. Those aren't even words!

lproven | 9 hours ago

"the modeless editor installed on Linux".

Er... it's the opposite of modeless.

It is modal, and apart from vi[m] modal software has become rare.

Otherwise, I agree.

gerikson | 8 hours ago

You are correct, sir! I appreciate the update.

fedemp | 7 hours ago

I'm on Fedora right now so I can't confirm, but I'm pretty sure Ubuntu defaults to vi for $EDITOR so it makes sense there are tutorials that say "type vi".

hugoarnal | 14 hours ago

I don’t really know how to feel about this.. As a recently active Linux user, I prefer when vim is installed as I’ve grown familiar with some of its features (Syntax Highlighting in particular). I totally understand and get the argument of the original vi should stay vi, but vim now provides an overall better user experience (whether it be new or experienced user). I guess a similar argument can be held for multiple things (git-diff vs diff, coreutils vs uutils). Perhaps distros should provide defaults that can be modified, like symlink vi to vim but also provide a vi package (isn’t this what Ubuntu does?).

adam_d_ruppe | 10 hours ago

My Slackware install has always used elvis as vi and vim as vim for as long as I've had it (going back to late 2004). I didn't even know the original vi was used anywhere by anybody, I thought at most you'd get one of the clones in stripped-down mode (which kinda infuriates me because it just seems to disable basic things that have no reason to be disabled, so i guess i agree with the author there).

lproven | 9 hours ago

Strongly agreed.

Vi is primitive and clunky not because it's a bad design, but because it's from 1976 and computers have changed a lot since then. It dates from a pivotal point: when glass terminals had replaced teletypes.

Glass terminal means with a screen, so any point on the screen could be changed at any time. Screen means a CRT, and that means specifically text-only and single-colour.

But before microcomputers, before a mass market in software that individual people could get and use on their own computers. Vi was from the end of the era of computers that cost as much as a house and so which you had to share.

So, terminals with screens were becoming common enough that an editor designed for them caught on.

But it was before microcomputers, where the computer was so closely coupled with the screen and keyboard that soon they were built into the same casing.

Screen + keyboard + computer in one unit == Commodore PET.

Keyboard + computer in 1 = Apple II

Keyboard, screen, and computer all sold together: TSR-80

All 1977, the year after vi appeared.

Computers with their own keyboards, or in their own keyboards, led to keyboards designed alongside the computer's OS.

Before then terminals were printers with typewriters: instead of just printing, the keyboard sent codes to the computer, and the computer sent them to the printer. Replace printer with screen, this still happened.

A mass market in software for individuals led to UI conventions and keyboard improvements.

Typewriters only have Shift and Tab. But as glass terminals went mainstream, then microcomputers which came with their own dedicated keyboards, they sprouted lots more keys.

Vi is from the early stage: it expects "Esc" and there's a combo for that.

What came right after it was Ctrl and Alt... and at first they went a bit crazy and there was Meta and Hyper and so on too.

To this day, the meaning of "meta" has not been agreed. Emacs and relatives mean one thing, KDE and relatives mean a different key.

Along with these keys, and a way to represent them as bits in a byte, nicknamed after a teenaged Niklaus Wirth -- "Bucky bits".

(I am guessing this is from him having European teeth not as even and straight as American kids who if they were from families rich enough to send them to university, all had braces.)

Along with all those keys came arrow keys and forwards and backwards delete keys, and rows of F-keys.

And it shows because vi doesn't use all this. It uses letters and Ctrl and nothing much else.

Once all the keys were they, software started to use them. Result, a Cambrian explosion in UI diversity. That's the era Emacs is from.

Then, next, came a great extinction event, as most of the dozens of weird 1980s computer makers went broke, and the industry standardised on CP/M replaced by MS-DOS, and PC clones, plus off to one side a few makers of GUI computers: Apple, Atari with the ST, Commodore with the Amiga, Acorn with the Archimedes.

And a matching great extinction event in UI design, as IBM-lauout keyboard became the standard and GUIs standardised software UI. DOS standardised UIs on CUA as it fought to stop Windows taking over.

It failed. Windows uses CUA. GUIs and CUA killed modal editors and weird UIs.

The Unix world stayed on minicomputers and their single-user descendants, workstations. It avoided all this standardisation. Keyboards stayed weird, UIs remained chaotic.

That's why vi is still weird, and so is Emacs in totally different ways.

The sad thing is this:

Those standardised UI are good ones backed by millions in R&D spend. They are better UIs than vi -- any vi.

Vi users like the rich keyboard controls, and won't move. But CUA editors have equally rich keyboard UI and if you know it you can drive all GUI apps with the same UI. This is massively useful. You can drive the whole OS and all its apps at the speed and control and power of a Vim user who's been practising for a decade.

And it hasn't gone away because this is also the UI that all blind and visually-impaired users use, and those with serious motor coordination problems.

But the Linux shell came straight out of minicomputers and workstations and never got standardised like this.

And a matching great extinction event in UI design, as IBM-lauout keyboard became the standard and GUIs standardised software UI. DOS standardised UIs on CUA as it fought to stop Windows taking over.

I have no idea what you are saying here. DOS in common parlance usually means Microsoft DOS, and Windows usually means Microsoft Windows, so you have Microsoft fighting Microsoft. It doesn't make sense to me.

It failed. Windows uses CUA. GUIs and CUA killed modal editors and weird UIs.

What failed? What is "it"?

ksynwa | 17 hours ago

Now I'm curious about the xterm quirks they mentioned

Off the top of my head (and partly researched from skimming my own blog), my undoubtedly incomplete list is:

  • ziconbeep, which I rely on
  • xterm's way of making large selections
  • xterm's very specific text selection rules about what's a "word" for double-click selection, where more things are word boundaries than in eg gnome-terminal. My reflexes are extremely attuned to these.
  • being able to turn off text colors

There are some anti-features that I don't want that modern Unix terminal programs have, or have by default. Gnome-terminal wants to grab all URLs visible in text and make them into clickable links, for example, and I find this very irritating for various reasons.

(I'm the author of the linked-to entry. This is an incomplete list since it's been a long time since I seriously tried to use another terminal program.)

ptman | 14 hours ago

search their blog for xterm