
Bill Joy's greatest gift to man – the vi editor (2003) - spking
https://www.theregister.co.uk/2003/09/11/bill_joys_greatest_gift/
======
nouveaux
For those who do not understand why people are fanatical about vi, here are
some reasons:

Vi is keyboard only. This means that actions with the mouse are optimized
through the keyboard. There are "hotkeys" for most tasks you use with a mouse.

Vi has the idea of objects. Words, lines and paragraphs are objects you can
operate on.

Vi defines a "language" for operating on objects. For instance, 'd' is delete.
You can delete a word using 'dw'. You can delete 5 words with '5dw'. Another
example: deleting a line is 'dd'. Delete 5 lines with '5dd'

It is a modal editor. At a basic level there is an "edit" (insert) mode, a
"navigation" (normal) mode, and a "selection" (visual) mode. The power of a
modal environment means that commands and hotkeys now have a context and do
slightly different things in different modes. While this may be overwhelming,
once all these modes are ingrained in you, it allows you to be extremely
efficient since you do not have to remember new hotkeys. For example, in the
navigation mode, you can apply the 5dd to delete 5 lines. In selection mode,
use '5w' to select five words. 'd' now deletes everything in the selection. If
you've ever struggled to manage and remember your hotkeys, modal environment
is your friend. (set this up in mac using something like hammerspoon.)

It includes some really nice out of the box features: Macro system to save you
time with repetitive tasks, regular expressions search and replace, time
travel through your edits, it stores your edits in a tree so you can navigate
to your changes even after multiple undo/redo. "." repeats the last change.
You can also apply a number before it to repeat the change n number of times.
I am surprised how often I use this that this is and this is first thing I
miss when using another editor.

Vi is worth learning as it will improve your productivity. This is especially
important if you have to edit a file on a remote server. Vi is installed on
every unix distribution. Many cli tools and shells have a vi mode. This allows
you to take the vi 'language' to all these cli tools for more productivity.

For those who struggle to learn, I highly recommend Vim Adventures. After
that, force yourself to use vi for your every day edits and it'll be second
nature in a couple of weeks.

[https://vim-adventures.com](https://vim-adventures.com)

~~~
tgb
I've always thought that doing 5dd and such was a bad demonstration of Vi(m)
since I never know how many lines to delete. I'll just dd multiple times. More
powerful vim commands are like daw (delete all of a paragraph), di) (delete
inside of a set of parentheses), and dtX (delete until the character X).

~~~
leephillips
daw deletes the word you are in (delete a word). But dap deletes a paragraph.
And you can tell vi what you mean by "word" and "paragraph" (I think) in your
settings file.

~~~
tgb
Good catch, I meant dap.

------
steffan
Let's not forget Bram Moolenaar, who also deserves credit for extending the
work on Vi. Vim [Vi iMproved] is likely (along with NeoVim) the actual Vi
editor most people are using these days.

~~~
skohan
What's the story with NeoVim exactly? I am trying it out on Linux because I
got some recommendations that it's better than Vim, but I've run into some
problems because for instance with setting up plugins and things, lots of
times the documentation seems to be geared toward Vim, and sometimes I've
gotten errors it's hard to figure out because of this.

It kind of gives me the perception there just aren't that many people using
it, so it might be one of those tools which is technically better but doesn't
have the critical mass of community to really be useful.

Am I off base there? I mean what are the tangible, user-facing advantages of
NeoVim over Vim?

~~~
maximusjesse
Neovim definitely has significant market share, you can compare Github stars
as one statistic to consider:

[https://github.com/vim/vim](https://github.com/vim/vim) \- 20k
[https://github.com/neovim/neovim](https://github.com/neovim/neovim) \- 36.5k

This is in some part due to the fact that neovim has been on Github longer,
but it's still a a major indicator.

Neovim has many benefits over Vim, and has been applying pressure on Vim for
years to improve its own development and codebase. Nvim has first class
support for Lua outside of Vimscript, which has enabled a lot of people to
write more powerful plugins. A lot of NVim's featureset has been copied into
Vim over the years (one of my favorites is the hover window, which has allowed
IDE like support for code references/comments/source). Supposedly, Nvim's
codebase is significantly easier to maintain and contribute to, due to the
nature of having a community of contributors that built it from ground up, as
opposed to one primary developer working on Vim.

The parity has reduced over the years, but Nvim has been significantly ahead
in pushing new features and active development over Vim resting on its
laurels.

~~~
war1025
NVim certainly has it's own cult following, I would expect that it pales in
comparison to Vim for actual day to day usage.

Glad to see the project is still alive and moving forward. Seems like most new
editors or forks in general die a quick death.

~~~
edanm
> NVim certainly has it's own cult following, I would expect that it pales in
> comparison to Vim for actual day to day usage.

Why? It's a fork of vim, which adds some functionality and removes some
functionality. But it's not an entirely new editor or anything.

~~~
war1025
> Why?

Not sure what you are questioning exactly.

Why does it have a cult following? Because there are enough people to keep the
project going and it makes them happy for whatever reason.

Why does it have far less usage than Vim proper? Because it's a young, niche
project, and Vim has been around forever. Same reason CentOS and Ubuntu have a
far bigger usage share than any of the "trendy" distros.

~~~
edanm
Ah sorry I misunderstood. I thought you meant it has functionality for day to
day usage, not just less users. My mistake!

------
taylodl
"Among Joy's list of achievements are BSD Unix, NFS, UltraSPARC designs and
some work on Java" \- not to mention Berkley Sockets. But his greatest gift to
man was vi? I think not!

Full disclosure: I'm an "emacs guy" but I don't care about the silly old
emacs/vi wars. I would just say as awesome as people find vi to be, it's among
the least of Bill's accomplishments. That's how awesome he is!

~~~
PaulDavisThe1st
I don't know how much he was involved in the "3M" model that Sun pushed, but
that was pretty big too: 1 Megabyte of memory, 1 megapixels on the screen, 1
Megabyte/sec network connection. All seems like nothing now, but at the time
of the early Sun workstations, that was the definition of a high end machine.

~~~
m463
I think more people should shoot for something like that.

I remember when tesla first created it's electric cars and they put these huge
expensive batteries in them.

Other cars required an engineering degree to figure out how to get across town
and back, and tesla had these cars that freed up your mind and let you drive.
and then they could build on that with the supercharger network.

Eventually the range went up and the battery cost went down and the future was
the present.

------
ben7799
Vi is the ultimate example of software that is "easy to use" as opposed to
"easy to learn", it is great that we still have Vi and so many other unix
tools that use the same philosophy.

One of the biggest things that has happened to computer software in modern
times is the balance between "easy to use" and "easy to learn" has shifted
dramatically towards "easy to learn".

There is some software that can achieve both at the same time but IMO much of
the time the two ideas are counterbalanced against each other with each
hurting the other.

Before the mouse almost all software was harder to learn but users would
become extremely fast & efficient when they learned to use it. Vi is a classic
example. So were lots of applications that had character cell user interfaces
and function keys & shortcuts for everything.

A lot of mobile stuff is the ultimate opposite.. it takes 2nds to learn but
you're never going to be able to use it any more efficiently or quickly than
you did 5 minutes after you first tried it.

~~~
combatentropy
I agree. While vi has an unusually steep learning curve among software, I
think of it sometimes when I design user interfaces. Design with the 2-week
user in mind, not the first-time user.

What I would call fraidy-cat designers work themselves into a tizzy asking
themselves, yes, but will users like it or understand it the first time they
see it? I encourage people to instead be a bit bold and ask, will the user
grow to like it after using it for a week or two?

There are three kinds of software:

1\. Easy at first, and mediocre for the rest of your life.

2\. Takes some getting used to at first, and awkward for the rest of your
life.

3\. Takes some getting used to at first, and wonderful for the rest of your
life.

I suppose there might be tools that are easy at first and wonderful for the
rest of your life, but they are rare. Most classic tools are in the last
category. And it's not just software. An audio engineer probably took a long
time to learn how to use a mixing board, but now it's second nature. Manual
focus on a professional camera, also something that's hard at first but
effortless and even preferred after practice.

The thing is, if you optimize for the first-time user, you might be blocking
yourself from making something really powerful and simple, though at first
strange. Some of the best things in life are at first strange.

In case someone is still trying to read my post in bad faith, of course you
should not make it harder than necessary for first-time users. Designing
interfaces is hard work. This is not an excuse to be lazy. It is an invitation
to make your software as good as possible for long-term users.

~~~
gen220
fwiw, I totally agree with everything you've written, and take it in good
faith.

I've heard the words "power tool" and "platform" used to describe what you're
talking about. The best tools have a simple core with many silos, but those
silos are highly-configurable and composable. You can call it UNIX-philosophy,
but it's evidently existed in other domains (carpentry, baking,
"interchangeable parts" in manufacturing) for a very long time.

I don't think there's a lot of software written this way. Vi, Excel, UNIX
pipes, functional programming languages, regular expressions, GNU ledger,
Redis come to mind.

Not a lot of consumer software fits this description, that I can think of.

------
madmax108
Required reading for anyone who uses Vi (or wants to take the dive)

"Your problem with Vim is that you don't grok vi." :
[https://stackoverflow.com/a/1220118](https://stackoverflow.com/a/1220118)

Anecdote time:

Just a few hours back, I was working with a json file and needed a way to copy
data between 2 matching parens in a Json node.

'v' is vi-speak for switching to visual mode '%' is vi-speak for skip to
matching param 'y' is vi-speak for copy (or yank)

So 'v%y' is for switching to visual mode and jump to matching param (which
visual mode highlights text) and then copy the highlighted text.

Ah, the joys of vim! Truly one of those tools that can elevate your whole
productivity once you grok the basics! :)

------
JJMcJ
He also created Berkeley sockets, which pretty much powers networking today.

~~~
smabie
I personally think that the Berkeley socket api is really _really_ ugly.
Plan9's networking api is very nice, though:
[https://9fans.github.io/plan9port/man/man3/dial.html](https://9fans.github.io/plan9port/man/man3/dial.html)

~~~
JJMcJ
The man page in the link has further links to source code.

Seems like the API is built on top of sockets, which is not a bad idea.

I certainly agree that sockets can get tedious.

~~~
p_l
the plan9 port API is based on sockets, yes - because plan9port is a port of
plan9 runtime to other OSes.

However, BSD Sockets are _bad_ API, and can be argued to be one of the
reasons, if not _major_ reason, behind many issues in IP-based networks,
including slow IPv6 rollout.

They also were a rushed port/rewrite of existing TCP/IP code done essentially
by grad students on a grant from DoD because vendor (DEC) told DoD that they
are not getting any new models of the computer they used primarily for TPC/IP.

Part of the requirements was that the resulting code is shared so that vendors
could quickly provide support for TCP/IP in various products.

------
bradford
My career as a software developer is indebted to vi.

text editing can be a thankless, soul-sucking chore without the proper tools.
I've seen otherwise intelligent individuals abandon a software career because
they never quite figured out how to efficiently do it. I wouldn't say that
vi/vim is the only tool that can do the job, but it's the one that I've
chosen.

I was introduced to vi by a stroke of fate. My buddy in college pulled me
aside and introduced it to me. I initially thought he we crazy because we had
no shortage of schoolwork to do and vi just seemed impenetrably nuts. Really
glad he did: my career might have taken a very different arc without that
encounter.

------
bdamm
vi has been life changing. Learning vi altered my entire concept of what
interacting with text could be, and even my personal physical relationship
with a keyboard. Using vi is like driving a stick shift; satisfying in the
depth of control once the learning curve is done. vi has been a daily friend
now for over 20 years. So much insight is cooked into those little key
mappings.

~~~
scottlocklin
> So much insight is cooked into those little key mappings.

Just a point of historical order, didn't those key mappings mostly come from
ed? Aka Ken Thompson and Ritchie?

~~~
gen220
yes they definitely do. ed -> ex -> vi

It's fascinating to read comments praising how great it is that you can edit
text without a mouse.

ed was written to interface with tty systems, where mice weren't even a thing
to be avoided. :)

~~~
bdamm
It's not about doing it without a mouse, it's about doing it fast,
comfortably, and powerfully. Pointers are a useful addition to graphic capable
vi implementations, but if you do everything with mouse or trackpad movements
then I don't think you can claim the zen of vi.

~~~
gen220
oh to be clear, I totally agree.

My fascination is that the original motions were not invented to escape the
imprecision of graphical pointers, even though that's their main selling point
today. They were invented to minimize (1) excessive tty printing, because
printing is slow (2) keystrokes.

That, in 2020, these optimizations made in 1960 allow you to avoid the
imprecision and slowness of a graphic pointer, we get for free :)

------
coliveira
I used Emacs for 5 years before learning vi. What a change! While Emacs tries
to put the kitchen sink inside the editor, vi tries simply to be a keyboard
interface to the rest of the system. I've never looked back since I learned
this way of working.

~~~
umvi
I've tried several times to get into vim. I feel like it's similar to dvorak
though - unless you use it 24/7 you won't develop the muscle memory necessary
to use it efficiently.

~~~
KSS42
Using it 12/7 was enough for me for me to be become proficient. ;)

~~~
ztoben
If it takes 84 hours a week of use in order to become proficient I think I'll
pass.

~~~
kleer001
Maybe 80 hours total, but then that's it. And then you have speedy skills that
can serve you in almost any command line environment. AND vi commands are used
in a lot of other places, like man pages and such.

------
DonHopkins
On Nov 8, 2018, I sent Bill Joy a birthday greeting: "Happy 17,179,869,184
MIPS Birthday, Bill"! (2 to the (year - 1984))

Bill Joy’s Law: 2^(Year-1984) Million Instructions per Second

[https://medium.com/@donhopkins/bill-joys-
law-2-year-1984-mil...](https://medium.com/@donhopkins/bill-joys-
law-2-year-1984-million-instructions-per-second-3a8c92165cfe)

>The peak computer speed doubles each year and thus is given by a simple
function of time. Specifically, S = 2^(Year-1984), in which S is the peak
computer speed attained during each year, expressed in MIPS. -Wikipedia, Joy’s
law (computing)

>C++++-=

>“C++++-= is the new language that is a little more than C++ and a lot less.”
-Bill Joy

>In this talk from 1991, Bill Joy predicts a new hypothetical language that he
calls “C++++-=”, which adds some things to C++, and takes away some other
things.

[https://en.wikipedia.org/wiki/Joy%27s_law_(computing)](https://en.wikipedia.org/wiki/Joy%27s_law_\(computing\))

>Introduction

>These are some highlights from a prescient talk by Bill Joy in February of
1991.

>“It’s vintage wnj. When assessing wnj-speak, remember Eric Schmidt’s comment
that Bill is almost always qualitatively right, but the time scale is
sometimes wrong.” -David Hough

------
narrator
It's amazing how fast one can edit text with vi once you get all the keys
down. There used to be a video game that taught how to use VI. Is it still
around?

~~~
skohan
Some things seem unnecessarily unintuitive to me about the shortcuts. For
instance, using 4 in-line keys for navigating a 2D space seems like a wasted
opportunity. Every video game ever came to the conclusion that the inverse-T
layout is ideal for this task.

~~~
saagarjha
I mean, putting all they keys in the home row is admirable but the up/down
placement seems so counter-intuitive! Almost everywhere I see arrow keys put
in a line up comes first…

~~~
fsckboy
^H in ASCII is backspace (move carriage to the left), and ^J is linefeed (move
carriage down), so h-j were completely intuitive to people who already knew
ASCII (i.e. everybody) and then it just makes sense to continue the row of
other cursor movements.

"intuitive" doesn't mean "I was born knowing it"

------
millstone
I watch in awe as vim experts fly with amazing speed. They have undeniable
powers, built on top of highly personalized .vimrcs. And I try to learn, but
get stranded in the very basics.

Example is searching for text on my system clipboard. There's no way to do
this in vim: it insists on interpreting special regex chars. If you google it,
you will find line noise that you can paste into your vimrc; these solutions
inevitably have caveats and are now personalized to you.

(I asked our resident vim expert how he accomplishes this, and he seemed
confused why you would ever need to do that. vim is its own universe, huh.)

Anyways looking for practical suggestions for getting into vim - a "cheat
sheet" that has actually worked for someone!

------
zzo38computer
I think vi is good. I think the modal editing is good. The ZZT external editor
I wrote (ZZTQED, and later frezed) is inspired by features of vi, such as
modal editing, numeric prefixes, macros, etc. It is also good that vi has the
ability to interact with external programs by pipes, which is something that
Heirloom-mailx also does and I like that, and my own NNTP client software
(bystand) also does, but unfortunately the web browser doesn't (the web
browser is one of the worst software). One problem with many newer programs is
lack of good documentation as well as using mouse-based interface; I like to
make most functions working by keyboard commands. A lot of existing software I
don't like so much, so I try to write my own better ones, which can use pipes
with external programs, using mostly keyboard-based interface rather than by
the mouse, using UNIX philosophy, using you have enough ropes to hang yourself
and also a few more just in case, etc, to do what I will think is a good idea
to do. And yet, it isn't just a lot of computer software that is badly
designed these days, but even user interfaces of VCRs, DVD recorders, etc. I
don't really like MSE so much, so I wrote TeXnicard. I don't really like most
NNTP software so much, so I wrote bystand. I don't like KevEdit so much, so I
wrote ZZTQED. I don't like Inform so much, so I wrote Glasm. etc

------
psim1
The first editor I used was pico, then nano. I joined a sysadmin team shortly
after college and they said they would not install those tools on the Sun
servers; I had to learn vi. I wasn't prepared to argue but I wanted to know
why. They said you'll find vi on almost every system and it will work fine in
almost any terminal. To me there was a lot of value in that, and once I did
learn vi, I liked it for all of the other reasons folks are mentioning in this
thread.

------
mckinney
Ok, I get that vi is a legend etc. I think I understand why, but I'll keep
that to myself. But honestly, it's a relic. Hell, it was a relic in the late
80s when I was in college! Few of my classmates bothered with it unless they
HAD to use it, which in my view is what makes vi so sticky. We can thank the
academic community for perpetuating it as some kind of "expert" tool and
encouraging or even requiring students to use it. The same ignorance that
keeps CS dogma alive such as "good programmers don't use GUI debuggers or
IDEs." My college age kid in CS came home parroting this nonsense. But at this
stage of her education I'm quite used to unindoctrinating. There is no reason
a university should teach kids to use vi as a primary code editor. It's a
crime in the context of a modern, statically typed language such as Java.

~~~
zanellato19
But it is an expert tool. Does that mean that a GUI editor isn't? Not at all.
But I don't expect my non-programmers friends to use vi/vim (or any person,
really), but its definetely something that proves its worth to programmers
more than to other people. The elitist attitude is terrible, I agree, and
people should use it for whatever they want, but to deny that it is an
expert's tool is wrong, imo.

------
asciimov
BTW it's :x to save and exit.

~~~
rantwasp
ZZ for the win (3 keystrokes vs 4 for :x)

~~~
arunix
I use command mode a lot, so have swapped ":" and ";". With that, :x + enter
is 3 keystrokes, and hitting x is a bit easier than hitting z.

~~~
asciimov
I aliased it so either : or ; work for :

I admit I typed :wq for more than a decade before learning about :x

~~~
devchix
:wq! because I really mean it!

~~~
rantwasp
why not just :q! to live dangerously :)

------
koonsolo
Mandatory link for those who wonder "Why, oh WHY, do those #?@! nutheads use
vi?"

[http://www.viemu.com/a-why-vi-vim.html](http://www.viemu.com/a-why-vi-
vim.html)

------
CalChris
Dating myself, but I found _vi_ fairly easy to learn since I had used _TECO_
on DEC machines. I rather liked _TECO_.

    
    
      iHello World\n<escape>
    

is the same in _TECO_ and _vi_.

------
cbsmith
Sad to see Bill Joy's contributions so minimized.;-)

------
ulisesrmzroche
Highly overrated, and I’ve been using Vim professionally (or vim emulators)
for ten years now. I’m just used to the keys - muscle memory - but that’s it.
(Its actually my first editor, my first job was at a place with a lot of
vimsters)

There’s no proof that it makes you more productive or a better programmer.
It’s actually gonna trip you up and get in your way if you don’t soup it up
like an IDE

Downvote away

------
DonHopkins
"I wish we hadn't used all the keys on the keyboard." -Bill Joy

Interview with Bill Joy from the August 1984 issue of Unix Review magazine:

[https://github.com/sysprv/vimrc/blob/master/joy84.html](https://github.com/sysprv/vimrc/blob/master/joy84.html)

------
xwdv
Thank you Bill Joy, no other tool in my programming career has been as
impactful as vi, and all its iterations.

------
downerending
If the original vi used 'jkl;' for movement and put a startup message on the
screen for newbies explaining how to exit, I'd probably be using it today.

Turns out that was enough to send me on to glorious decades of emacs.

------
neves
The Unix Hater's Handbook is an excellent read:
[https://web.mit.edu/~simsong/www/ugh.pdf](https://web.mit.edu/~simsong/www/ugh.pdf)

------
forrestthewoods
Yesterday I spent an hour trying to figure out how to NOT use vi to make a
Mercurial commit on macOS. It was one of my most frustrating computer
experiences in recent memory.

~~~
nouveaux
My guess is that you ended up on a machine that has the default editor as vi.
TO fix this, set your shell's EDITOR env variable to something like nano.

I agree that VI's default is so different from the modern editor that it's
very frustrating to get stuck in it. However, learning vi pays dividends.

~~~
forrestthewoods
I tried setting the editor to TextEdit app path. That didn’t work. I also
tried Sublime, which also didn’t work.

Setting the editor is really a 3 step process. Add application to PATH. Create
an alias. Specify the alias.

VSCode has a command to do steps 1 and 2 for you.

My next weekend project is to learn Vi. (Any tutorial suggestions?) I don’t
want to. But I have to. Smartphones are so intuitive toddlers can use them. Vi
is so non-intuitive it requires going to external tutorials to learn how to
edit text. Sigh. :(

~~~
nouveaux
Use vim adventures to learn. It will take the pain out of learning and will
make you proficient in about a day.

After that, force yourself to use it. Install vim plugin in vscode. In about 2
weeks, you will wonder why you didn't learn it sooner.

------
sunnytimes
I used to use vi all the time and the joke always was

"vi is a four letter word"

------
riffic
the vi editor is a masterpiece for the ages. a true work of art.

------
dieselerator
tl;dr The Register interviews Bill Joy about writing vi over a very slow data
link.

I use vi (m) every day. Thank you, Bill Joy, and Happy Birthday whenever chron
brings it up.

~~~
abjKT26nO8
What is chron?

~~~
PEJOE
cron is a tool to schedule tasks

see: [http://man7.org/linux/man-
pages/man8/cron.8.html](http://man7.org/linux/man-pages/man8/cron.8.html)

and: [http://man7.org/linux/man-
pages/man5/crontab.5.html](http://man7.org/linux/man-
pages/man5/crontab.5.html)

~~~
abjKT26nO8
But what does "chron" have to do with cron? Or was that a typo?

~~~
PEJOE
typo on my part, but the etymology of "cron," is related to "Chronos," if you
didn't know

