Understanding the Origins and the Evolution of Vi & Vim

,

A nice article about the evolution of programming editors, ed, em, vi, vim and numerous clones.

https://pikuma.com/blog/origins-of-vim-text-editor

5 Likes

I’ve used ed (and had forgotten ex). For some reason I have a fondness for the famous phrase in the man page:

ED(1)               Unix Programmer's Manual                ED(1)

NAME
     ed - text editor

SYNOPSIS
     ed [ - ] [ -x ] [ name ]
DESCRIPTION
     Ed is the standard text editor.

I found a way to run Unix V7 in the browser, managed to mount /dev/hd0e as /usr, and

2 Likes

Author here. Thanks for the share.

4 Likes

Thanks for the article @GustavoPezzi - I enjoyed it all, even though I seem to have zoomed in to one tiny aspect!

I think it might be a generational marker, that I think of vi as normal and vim as something new, whereas people just a little younger might use vim but call it vi.

2 Likes

For some reason :grin:

2 Likes

I’m a bit younger, but I also learned vi first, and think (and say) vi, not vim. I’m primarily an Emacs user, though, so I don’t think I do a lot of vim stuff that isn’t vi stuff. Way back when I was learning Unix the first time (the early 90s), vi was usually not vim; it’s likely that it was elvis on Linux and maybe nvi on BSD, but I didn’t know the difference at the time. (I don’t know what it would have been on Solaris, maybe an actual vi?) I’ve always thought of it as just vi, ever since, although it’s quite possible that some of the “vi” commands that I use are actually vim, these days.

1 Like

I learned vi in 1981. I was a student at U of California, Santa Barbara. I can confirm that it was possible to use it over very slow terminals.

One thing I don’t see mentioned in the article is a feature that I think was essential to its widespread adoption: termcap. There were dozens of types of ASCII terminals in those days, with similar characteristics but different “escape sequences” for cursor control, screen clear, and so on. Termcap provided a simple way to describe each of these many types of terminals in an ASCII format that was easy to change and easy to share.

Today terminals are all virtualized and everybody understands DEC’s escape sequences as the de facto standard, so the need for termcap has largely gone away. But back in the 70s and early 80s the ASCII terminal marketplace was competitive and fast-moving. Vi worked, or could be made to work, on all of them. I think this was critical to its success.

3 Likes

Here’s a 5 min demo of using ED, on CP/M:

Longer version linked in the description.

(That’s in a CP/M playlist, which might be of interest, via these cp/m-tagged blog posts.)

1 Like

My first Unix experience - v6 on a PDP-11 was in 1980 and I used ed, but was very quickly introduced to em - the Editor for Mortals! vi wasn’t quite there on our system yet, but some years later on Sun3 workstations… vi!

I’m not sure when vim became the de-facto standard - probably when Linux started to gain traction but even today, I type vi rather than vim to start the editor…

Fun little bit of interest - as part of a team in the late 80s, porting Minix to a transputer system I was asked to write man - but that needed more (or less) which needed termcap and also troff… Also as a lot of the team were emacs enthusiasts that’s what they wanted. Emacs wasn’t going to run on the 8MB system (It was already know as Eight Megs And Constantly Swapping…) so I looked at MicroEmacs, but to do that, I needed (wanted) vi which resulted in Stevie (ST Editor for VI Enthusiasts) with termcap being the lowest common denominator.

-Gordon

3 Likes

em is back

2 Likes

“Works well off road” was a big feature of vi for me. Besides being quite comfortable over a 2400 baud modem it really shone when used on vt100 or other terminals hooked up to our campus network. UBC-NET they called it. Originally it was just to connect terminals via RS-232 to the mainframe. The Sun 3 Unix machines became accessible through some Rube Goldberg means. I think the RS-232 could be switched onto an X.25 network that had some gateway to the Unix ethernet LAN.

It worked but updates were very “chunky” arriving in bursts with considerable latency. This meant that moving around one character or line at a time with arrow keys was painful as you had to wait to see if you got the cursor in the right spot after several key presses were buffered.

The experience vi user could use word based commands to navigate with more confidence. And even input a fairly complex editing sequence without needing instant feedback. It made the whole setup much more useful.

Using hjkl for cursor movement meant never having to get a “full” termcap entry that described the arrow keys. Something the emacs guys always had to do whenever a new terminal was encountered. Popular games like rogue and hack used the same keys for movement so it was easy and fun to get really adept at using them.

2 Likes

One of the high points of my Unix support career was advising a secretary who never had used vi over the phone to edit the /etc/fstab of an Ultrix server to comment out a disk that wouldn’t fsck cleanly (and then reboot). No, I am not even being sarcastic: she was smart and picked things up quickly.

3 Likes

I always found this somewhat odd, but when you look at the ASCII names for those keys in “control” mode it almost makes sense - H - Backspace (left), J, New Line (down), K - Vertical Tab (Up), L - Form Feed (forward)

But for a long time games didn’t want to use what I thought was a more sensible approach - possibly as they were simpler, so we got various combinations of A & Z and < and > (or comma and dot).

In todays enlightened world; WASD - easy to use with one hand leaving the other hand for many other actions. But those keys are already useful in vi. And having written several editors over the years I’ve found that there is never an easy way to approach this and you tend to default to what you are most familiar with.

-Gordon

1 Like

Back in the day I think I just thought “HJKL for cursor movement? That’s a bit odd but that’s just the way it is.” and onward I went.

Now as I approach 40 years of using them they are deep into muscle memory. When they’re listed I don’t even really remember what they do. I have to reverse engineer it by imagining I’m in vi and want to move the cursor right and sensing which finger twitches.

1 Like

Just another thought - I remembered using terminals to the PDP 11 system that had the arrows on HJKL - highly likely the ADM3a terminal:

So the question might be which came first - the terminal or vi …

-Gordon

1 Like

I think of J as resembling a downward pointing arrow… use J and K for next/previous in RSS reading.

If only Berkeley hadn’t cheaped out and bought the numeric/cursor keypad addons for their ADM3a terminals, Bill Joy might’ve developed vi with usable cursor controls …

I have been a very grudging occasional vi user since the early 1990s. Early on, I made an index card of all the commands I ever needed. It’s still one side of that card, and I refuse to learn more. CUA got to me first, and that storage was write-once.

I am going to sit on my fingers and not join this discussion because I know where it will lead. Discussing religion, politics, and editors never ends well.

1 Like

But Elvis would be on topic. :slight_smile:
As side note, CP/M users never had DEC terminals, they used what ever they could scrounge up.

So long as we continue to speak of things we used, things we saw, how things developed, I think we’re fine. It would be silly to start expressing strong preferences for one thing over another. Anyone could start a thread on some other family of editors if they wished.