
Where Vim Came From - janvdberg
https://twobithistory.org/2018/08/05/where-vim-came-from.html
======
j0e1
> While Emacs certainly still has a following, some people think that the
> Editor Wars are over and that Vim won.16 The 2018 Stack Overflow Developer
> Survey suggests that this is true; only 4.1% of respondents used Emacs.

I'm an Emacs user for years now and love the editor. But I'm curious about
this claim of its poor popularity. The article refers to a piece from
[http://www.linux-magazine.com/Online/Blogs/Off-the-Beat-
Bruc...](http://www.linux-magazine.com/Online/Blogs/Off-the-Beat-Bruce-
Byfield-s-Blog/The-End-of-the-Editor-Wars) which bases its arguments on two
surveys from 2013 and 2014.

Does anyone know of a credible way to measure the popularity of Emacs and what
the usage trends are in 2018 other than SO?

~~~
cup-of-tea
Very difficult to do with free software and completely irrelevant really. At
some point in your life it's OK to accept that you're the weird one. We're the
weird ones. Donald Knuth, Richard Stallman, Guido van Rossum, Rich Hickey et
al are the weird ones. I don't know why emacs is such a barrier to everyone
else or why vim is so attractive. But I don't understand most other humans
about most things.

~~~
raverbashing
Ok let me be very honest here, let's look at both editors learning curves

\- vi/vim

You need to learn to open a file, edit it, move around and exit and the
edit/view mode. Everybody learns how to do it. At first it sucks but you can
learn this in 5 min.

Nothing too hard, and yes, do use the direction keys, it's not the 70s
anymore.

From there you can learn other things

\- Emacs

You try reading anything about it, there's something about Meta key (and
apparently nobody can say what the actual _meta_ key is without some wrangling
from them because who knows if you're not coding on a Sun Sparc from the 90s
so they don't want to compromise).

Then something about a "prefix command" C-x (what is C? Control? Which other
program uses C as an abbreviation for that?) Buffers. What's a buffer?

I tried opening the help of both programs, VIM shows exactly what I mentioned
there. Move around, close this window, etc

Emacs? I'll copy-paste here (key bindings help)

> C-x Prefix Command

> \200 .. ÿ encoded-kbd-self-insert-ccl

> C-x 8 iso-transl-ctl-x-8-map

Why the F is this relevant or useful?

Then I try to quit and it's a bit of a wrangle until it gets Ctrl-C Ctrl-X
right (or the other way)

Everything seems like it's actively fighting the user, and making it more
difficult or convoluted than it should.

Usability problems are _never_ the fault of the user.

~~~
zealsham
Have you tried exiting vim? :D

~~~
JD557
I know this was intended as a joke, but exiting vim is now much easier than
exiting emacs (IMO), assuming that the user has some experience with UNIX and
uses `Ctrl+C` to exit most programs.

If I start vim and press `Ctrl+C` I get an helpful message saying "Type :qa
and press <Enter> to abandon all changes and exit Vim".

If I do the same on emacs, first the help screen disappears (which was the one
telling me to use `C-x C-c` to exit emacs and then I just get stuck with an
unhelpful message about creating new files.

~~~
scbrg
You could try opening the _File_ menu and selecting _Quit_ :)

------
gmiller123456
>As far as I can gather, Intel HEX files are meant to make binary images less
opaque

I know this is getting away from the main point of the article, but they're
purpose is more to have a standard format that compilers can generate and
eprom/device programmers could read without being concerned with the machine's
endianness. Pretty much any embedded compiler can produce a .hex file, and
pretty much any programmer will read one.

~~~
keithnz
It amused me that the hex file was described as esoteric given how prolific
they are in the embeded world.

~~~
copperx
That brought back memories.

When I was a kid I liked to poke around executables in the MS-DOS world. Hex
editors were limited in the sense that they wouldn't let me insert bytes into
the file, just edit existing ones. Because I didn't have access to an
disassembler or an assembler (they were sold at stores but they were too
expensive for me), I wrote a simple program that would convert a binary file
into a text file full of hex codes, then I could edit that, change jumps to
different addresses, change strings, and then I would reassemble the
executable with another program to see the effect. I used this to translate
programs and games to Spanish by changing the strings in the executable.
Messages in Spanish are in average longer than English ones, so I couldn't
just use a hex editor.

It's funny to me that the hex file format is a real thing.

~~~
keithnz
it's a bit more involved than just hex.... it specifies address ranges and
data that goes into those address ranges + more

see
[https://en.wikipedia.org/wiki/Intel_HEX](https://en.wikipedia.org/wiki/Intel_HEX)

~~~
phyllostachys
And, unfortunately, it is a destructive process going from elf to hex, as I've
discovered a few times. Intel HEX is just the data at what addresses so one
looses the section info and metadata from an elf.

I'm always happen to see when a uC vendor IDE keeps the elfs and the
programmer takes elfs.

------
Izkata
I see MS-DOS is mentioned near the bottom, but the part I was most curious
about was not.

When I got my dad's old Windows 3.1 laptop somewhere around 1999, I discovered
DOS and started fiddling with it, eventually discovering the "edlin" editor.
Everyone else though it was bizarre and hard to use, but I really liked it
because I could look at different parts of a file at the same time.

The commands were similar to the example given here for ed, but the output
much much easier to read. Does anyone know if it was another clone or just
coincidence?

~~~
skissane
> Does anyone know if it was another clone or just coincidence?

EDLIN was a clone of CP/M ED. Was CP/M ED influenced by Unix ed? I don't know,
but I somewhat doubt it. Gary Kildall's primary background was in IBM
mainframe and DEC minicomputer systems (in particular VM/CMS and TOPS-10), and
so it seems to me more likely that CP/M ED was influenced by DEC or IBM line
editors, than by Unix.

That said, Unix and IBM mainframe operating systems share some common
heritage. Both were influenced by CTSS. So, it may be that any observed
similarities between CP/M and Unix line editors could be due to that shared
ancestry, rather than any direct influence of Unix on CP/M.

~~~
enf
CP/M ED is more in the TECO tradition than anything else, through the DEC
influence. It is oriented around characters rather than around lines as the ed
family is.

~~~
DougMerritt
And if you keep going back, TECO (like QED) can be traced back (via ports,
rewrites, shared authors, etc) to the PDP 1 and Colossal Typewriter. All those
histories are intertwingled back then.

~~~
erik_seaberg
Heh, I'd forgotten that EMACS started out as "editor macros" that were
eventually ported from TECO's command language to MacLisp.

------
rounce
I wouldn't be surprised if a large part of Vim's current popularity stems from
EDITOR=vim by default on many distros, despite often having emacs and always
including nano. Even over a decade ago when I was in my early teens this
seemed pretty common.

~~~
chr15p
To be honest I've seen very few linux machines with emacs preinstalled, nano
seems to be part of the ubuntu default install (maybe debian too?) but isn't
on any fedora box I have immediate access too (it is available in the repos).
This might be because I mainly deal in servers with smaller installs than most
desktops.

I would entirely agree that a lot of vims popularity lies in it being part of
the default install on pretty much every unix box ever though. That and it
actually being a decent editor once you get over that initial insert
mode/command mode learning curve.

~~~
JdeBP
Because, of course ...

* [http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi...](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)

There is a whole history of why emacs is not likewise in the SUS, already
related long since by other people.

------
chocolatebunny
I pressed j on the blog page and was upset that it didn't scroll down.

~~~
jmcphers
There's a way to fix that. ;-)

[https://chrome.google.com/webstore/detail/vimium/dbepggeogba...](https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en)

[http://vimperator.org/](http://vimperator.org/)

~~~
kabacha
and [http://qutebrowser.org/](http://qutebrowser.org/)

------
thelazydogsback
Though e-lisp is great and I appreciate the power and regularity of Emacs,
Vi(m)'s mode-full, default cmd-mode editing that doesn't require ctrl + meta +
esc left_foot_pedal + wink-wink-nudge-nudge... seems so much nicer to me than
insert-by-default editing - thank goodness there are vim plugins everywhere.

The TRS-80 Level II line editor was very much in the spirit of "em", along
with other BASICs of the day.

And perhaps a nod to the even more cryptic Teco.

~~~
ubernostrum
I'm always kind of curious about comments like this -- it seems everybody
knows you have to play games of Twister and hit twelve control keys
simultaneously to do even the most basic things in Emacs.

But... I use Emacs. I've been using it for almost twenty years. And I'm
struggling to think of anything I use regularly the involves hitting more than
two total keys simultaneously (keys pressed in sequence obviously don't work
as an argument, since that's also how you edit in Vim). I think the only one
is query-replace, because it involves hitting Shift to compose the M-%
combination.

And I don't use a ton of custom keybindings, either. The only custom binding I
use that's simpler than the default is goto-line, which I have bound to just
M-g.

Do people genuinely run into cases where they frequently have to be hitting 3+
keys simultaneously to use Emacs? Or is this just one of those "everybody
knows" things that's actually completely false?

~~~
meken
> Do people genuinely run into cases where they frequently have to be hitting
> 3+ keys simultaneously to use Emacs?

Paredit mode has several useful ones for writing elisp.

\- C-M-f, C-M-b, and C-M-u (forward-sexp, back-sexp, and up-sexp)

\- C-( and C-) (barf and slurp commands)

\- C-M-k (kill-sexp)

M-: (eval-expression in the minibuffer) is also a frequent command for me.

I've overlaid several keys in the number row with Control and Alt, so they are
nice to press with my middle and ring fingers (as opposed to pinkies). I've
been meaning to write a blog post about this.

~~~
omaranto
Only barf and slurp are paredit commands, the others you mentioned (the sexp
motion and killing commands) are stock Emacs!

(Well, by default C-M-u is bound to backward-up-list, either that's what you
meant or paredit really defines a slightly different up-sexp commands. I don't
remember right now.)

The worst command I regularly use, in terms of number of modifiers, is
definitely C-M-% for query-replace-regexp.

~~~
eatonphil
Yep, I use those movement commands for getting to the beginning or end of
brackets when I edit JavaScript.

------
wolfspider
I still fondly remember lynx it was like the vi version of the web browser.
There is an O’Reilly book called “spidering hacks” which goes into some of the
advanced stuff. Lynx was the Swiss Army knife which could host, execute,
parse, and script web pages in a single command (lynxcgi). It was also
decentralized and could run through telnet or raw sockets inside a VMS system.
Vi keys and Emac keys were options either of them could be set as the html
editor making it seamless.

------
buchanae
I don't think I could write an editor with regular expressions from scratch in
a week. Especially if you took away the internet and 99% of my CPU and RAM.
Fail.

~~~
stevekemp
Yet Antirez wrote a cute curses-based editor over a weekend:

[http://antirez.com/news/108](http://antirez.com/news/108)

True it is missing regular expression-support, but it does have find, and many
people (including myself) have forked it to added regexps, lua-scripting, and
other advanced features.

------
Syssiphus
> Fred Fish was an American programmer that mailed out a floppy disk every
> month with a curated selection of the best open-source software available
> for the Amiga platform.

Fish disks contained mostly freeware/public domain as far as I remember. Not
open-source software.

~~~
JdeBP
The name "open source" had not even been coined at the time. "PD" was a
popular contemporary prefix for things, although their actual public domain
status was legally questionable, irrespective of the FSF's objections to the
idea.

------
whatyoucantsay
It's amazing we have Bill Joy to thank for not only C shell and much of BSD,
but also VI.

~~~
h1d
It's time to give a spotlight to NeoVim that puts efforts into getting rid of
legacy craft while maintaining compatibility to move vi past 50 years of
usage.

Last time I checked, there's no clear advantage from users' perspective for
now but some plugins have started targeting it as the primary platform and
also a few GUI are being developed too.

------
ekianjo
Fred Fish! That name brings bad memories of the good old Amiga days.

~~~
gumby
Fred Fish was a great programmer I was quite delighted to work with. We
happened to stop by his house on our honeymoon, (although that was because our
car broke down in Phoenix, but my wife liked him too). I was sorry when he
passed away.

------
calhoun137
When you are learning programming, its important to be able to isolate the
problem you are working on and focus on that. The fact is that vim has a steep
learning curve, and no matter how fast you are at typing things, your rate of
productivity is still limited by how fast you can make decisions and how fast
you can think and solve problems. I strongly believe that mastering hotkeys
and tools like vim is the final stage of achieving the highest levels of
programming skill. This is because once you have learned so much and trained
yourself hard to think and move really fast, only then does your productivity
bottleneck become things like using the mouse too much, not knowing certain
hotkeys, not using things like regex replace, multi-line edit, and so on. The
problem is mastering a single tool requires a tremendous amount of investment
of time and energy, and once you are at the point in your development as a
programmer where you need to start improving on hotkeys, well you are already
deeply invested in whatever tool you are using and making the switch to vim
has a major cost associated with it, because now you have to learn everything
you already know how to do all over again. Is this cost worth it? Sometimes,
depending on how advanced a person is, other times, depending on the
situation, it's not. I think this phenomenon explains a lot about why vim is
not as popular as perhaps it deserves to be.

------
Annatar
I still use the original, AT&T vi since I grew up on UNIX and Solaris 2.5.1
was my first UNIX OS after using my Amiga.

Even when I’m on a GNU/Linux variant, I run vim by calling vi, primarily
because syntax highlighting enrages me to no end.

vi won because it came with every UNIX by default, and when one is in a cold
server room connected to /dev/console via serial port at 3 o’clock in the
morning, one quickly learns to appreciate vi’s ready availability and
ubiquity.

Emacs on the other hand was always a huge program, was never bundled with UNIX
by default, and compiling it on one’s own always ended in failure somewhere
around Emacs wanting to compile itself as an Xwindows application. Add to that
that Emacs had completely different key bindings and users would have to adapt
to it rather than it letting them use their prior knowledge, it was a death
knell to Emacs. Later versions added vi key bindings (“evil mode”), but since
the pre-built versions continued to insist on Xwindows, it was wholly
unsuitable for servers; for example, an SGI Origin 200 or Origin 3000 didn’t
even have a frame buffer nor did they need Xwindows, and neither did the hp
K-, N-, or L-class servers. Meanwhile, vi continued to be the UNIX system
administrator’s trusty friend: always there, with no additional software
requirements.

Ironically, when I’m on the Amiga I use vim, but there it doesn’t have syntax
highlighting which I hate, and so is usable out of the box (I use it as I
would vi on UNIX, without any extra vim fluff).

~~~
krylon
FWIW, you can compile emacs without support for X11, and you can run it in the
terminal my adding the "-nw" parameter.

Not that I want to interfere with your choice of editor. ;-)

~~~
Annatar
I probably could, but vi(1) is muscle memory for me, and I use it in some very
advanced ways.

------
jhbadger
I'm an Emacs user but I'm really surprised at the number of (presumably, as HN
skews young) younger people here using vi or derivatives. Most younger people
I know use neither vi nor emacs, using Sublime Text or an IDE or something,
but vi seems much more alien to the modern worldview than Emacs, as it a modal
editor, which has died out in all but vi-clones these days.

~~~
maxnoe
26yo astrophysicist / datascientist here. Using neovim since two years now and
before vim for 3 years as main editor.

I don't know anyone below 40 using emacs. (Neo)Vim using (lots of) plugins has
a pretty solid user base around here. Most is Atom / VS Code / Jetbrains IDE
but vim has a solid standing especially along the more enthusiast programmers.

------
kmgr
That's a great read. I'm not a hardcore vim user, but like most devs I bump in
to it often enough to get somewhat familiar with its wacky interface. I always
had this feeling I'm using a legacy tool (in a nerdy positive way) even though
it's relatively young. This article shows that my feeling was quite accurate.

------
allcentury
Wonderful read, there was a lot of history there I didn't know

------
sbjs
It's also neat how TextMate syntax files came to be the de facto syntax format
that Sublime Text and VS Code use.

------
godshatter
I've tried emacs a couple of times over the years, but it never really stuck
for me. Not sure why. I use vim as my main editor on the job and at home. The
more basic commands have become second-nature and every now and then I go read
about something I haven't played with yet and make it part of my workflow.

I can't stand IDEs. I understand their benefits, but the amount of resources
they take up appall me at some deep level. I'll use them and grumble if I need
to. I haven't really liked an IDE since the Turbo Pascal 4.0 days. I also have
a thing about not liking software that tries to second-guess me. I'll take a
vim session loaded with files and another terminal window to build the project
in and I'm golden. Of course, I'm not working on huge projects for the most
part. Maybe it's an old-person thing.

------
fragmede
Since the article is explicitly about vim (over the original vi) by name, `:x`
is a shortcut for `:wq`.

~~~
petepete
Don't forget shift+zz

Definitely saves me whole seconds per year...

------
z3t4
"dismissed it, saying that he had no need to see the state of a file while
editing it"

------
asveikau
> How did Vim become so successful?

They didn't answer this question. The most obvious to me is that Linux distros
have had it as the default for decades. If FreeBSD caught on instead maybe
we'd have people writing the same article about the amazing history of nvi.

This is a weird thing to me. When I was getting started with this stuff,
everyone out there acknowledged that vim was a vi clone in the first breath.
There are now lots of folks that think vim is the primary thing. Kind of
similar to how they call shell scripting "bash". I guess it's rather like
asking what brand of Kleenex, or a Coke in the southeastern US.

------
gumby
From the article:

> ...Emacs could cost hundreds of dollars (this was before GNU Emacs)

Emacs clones (of various levels of compatibility) for unix and other systems
could be purchased back around the time this sentence is set, but to be fair,
the original Emacs (or EMACS -- the ITS filesystem only had upper case)
evolved by RMS et al from Gene Ciccarelli's TECO init file was naturally free.
And Bernie Greenbergs Emacs clone for Multics (called emacs because Multics
was case sensitive) was also free (and the first one, as far as I remember, to
be written in Lisp).

~~~
trn
[http://multicians.org/mepap.html](http://multicians.org/mepap.html) \-
Greenberg's "Multics Emacs: The History, Design and Implementation" is the
canonical Multics Emacs paper.

While "emacs" is the command to invoke emacs, it was always referred to as
Emacs in the documentation and the program itself.

You can use it at [https://ban.ai](https://ban.ai)

~~~
gumby
> While "emacs" is the command to invoke emacs, it was always referred to as
> Emacs in the documentation...

Multics's use of mixed case used to weird me out. (It was my problem...I
eventually got over it)

------
themarina
You know x does the same as wq? No need to complain vi made it too long :)

~~~
arendtio
Well, there are people who warn about :x

See the _comment_ with the most upvotes:

[https://stackoverflow.com/a/510333/1149404](https://stackoverflow.com/a/510333/1149404)

~~~
hudibras
brb, editing my .vimrc

------
grawprog
For some reason i'm not the biggest fan of vim on a computer. But, vim on
android with termux is the best editor i've found for android and I don't know
why but as weird as it may seem using vim with the right touchscreen keyboard
isn't actually that bad. It's the only realy solution i've found for doing
small amounts of programming on my phone. Nothing big, but for small hundred
line or so, scripts and such vim is definitely the best thing i've found to
use on android.

------
nebulous1
> Thompson paid a visit to Queen Mary’s, saw the program Coulouris had built,
> and dismissed it, saying that he had no need to see the state of a file
> while editing it.

Classic Thompson

------
xtf
How old are regular expressions, when the predecessor of `ed` already got it?

Edit: Found it[0]

Regular expressions originated in 1951, when mathematician Stephen Cole Kleene
described regular languages using his mathematical notation called regular
sets.

[0][https://en.wikipedia.org/wiki/Regular_expression#History](https://en.wikipedia.org/wiki/Regular_expression#History)

------
1_player
Great article, although the biggest takeaway for me was learning how to use
and exit ed. +1 point to my Unix street cred stat.

[https://www.gnu.org/fun/jokes/ed-msg.html](https://www.gnu.org/fun/jokes/ed-
msg.html)

------
digitalzombie
> How did Vim become so successful?

I recall the early days of RoR crowd were pushing for Vim too. It was hipster
in term of adopting new and awesome things and RoR crowd really push some new
things. This was when the editors war was still a thing.

~~~
simula67
One reason I switched from Emacs was because it took longer to launch

~~~
h1d
I don't see this gets mentioned much but this is one of the larger reason I
never use emacs. When quick editing files on remote servers, snappiness is
really nice, even with bunch of plugins activated.

~~~
cup-of-tea
You use it wrong. You're supposed to keep your local emacs running and use
tramp to login to the remote server. That way you still have your emacs config
with you and don't have to load it again.

What vim users don't seem to understand is: I never restart emacs. Mine stays
running for weeks, even months at a time. When I change my emacs config I just
run the code. I don't restart emacs.

~~~
kqr
You understate how great tramp is. It is what allows me to simply not care
whether a file system is local or remote. They all behave like local file
systems under tramp.

~~~
cup-of-tea
Describing Emacs using English is necessarily an understatement. It can only
be properly described using Lisp.

~~~
h1d
If a program cannot be described by a human language then the logic is flawed.

------
bayesian_horse
I've been using vim for a long time now. Mainly because I haven't figured out
how to quit yet.

------
dosy
This is a great historical trace / origin story. And now it all makes sense.
But I'm a little disappointed. As someone who came to vim from the world of
Notepad / Wordpad / WordPerfect / Word, vim, when I finally learned how to be
productive in it, seemed so revolutionary and amazing. I sort of was hoping
for a story that justified this feeling, like "Bram had a dream one night
where alien greys appeared to him and told him he had a mission for humankind.
They then showed him source code for a perfect text editor used in the
Aldebaran system for millennia. It's name, they said, would be vim. Bram
created it in a non-stop 3 day sprint before expiring for 1 month."

~~~
TeMPOraL
This is, in fact, the story behind Lisp Machines. Unfortunately, humans
quickly forgot the lessons from the aliens, and made computing the mess it is
today.

The history is documented here:
[http://landoflisp.com/](http://landoflisp.com/) (scroll down and follow the
arrows).

~~~
pantalaimon
Relevant XKCD [https://xkcd.com/224/](https://xkcd.com/224/)

~~~
dosy
Hahaha, perl.

------
qubax
Vi?

~~~
earenndil
QED, ed, ex, vi, elvis, stevie.

------
hyperpallium
People think seeing more lines at once - biggers displays, multiple monitors -
makes them more productive.

Let's compare what the people in this article accomplished and how many lines
they could edit at once:

    
    
      C, unix - 1 line
      BSD unix - 24 lines
    

(Not really fair, as a hardcopy has many lines).

> Vim is the most popular text-mode (i.e. terminal emulator) editor

I'm pretty sure the vast majority of programming is done in an IDD, not a
terminal.

> good ideas accumulated gradually over time. ... enjoyed contributions from
> some of the greatest minds in the computing world.

A bigger factor is preseving investment in muscle memory. e.g. The choice of
hjkl was not genius (any more than qwerty). But why change once fluent?

