Live data from Hacker News

Bill Joy's greatest gift to man – the vi editor (2003)

theregister.co.uk

81–90 of 186 posts

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#81

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.

I used vi and vim for about 25 years before switching to Emacs. I did this because: 1 - I got deeply interested in Lisp and Scheme, and Emacs was reputed to have the best editing environment for these languages 2 - Almost all of Emacs itself and Emacs' entire package ecosystem is written in eLisp, which is a tremendous improvement over vimscript, in which almost all vim packages are written. I'd just rather read and…

Also: Emacs has shell windows, process management, and output filtering, and keyboard macros, so it can run and control and respond to sub-processes (kind of like "expect" on steroids).

I could not give up running shells in an emacs shell window, capturing all the output as normal text I can edit and search with the full power of emacs, instead of a dumb scrolling terminal emulator, and the ability to make keyboard macros that hop between text files and dired directory listings and shell windows, copying file names and data to fire off sequences of shell commands. Easy on-the-fly automation of repetitive tasks. Why write a single use shell script when you can just do it once by hand while recording a keyboard macro, then repeat it thousands of times.

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#82
post #71

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 de…

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).

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.

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#83

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.

I used vi and vim for about 25 years before switching to Emacs. I did this because: 1 - I got deeply interested in Lisp and Scheme, and Emacs was reputed to have the best editing environment for these languages 2 - Almost all of Emacs itself and Emacs' entire package ecosystem is written in eLisp, which is a tremendous improvement over vimscript, in which almost all vim packages are written. I'd just rather read and…

>4) Emacs had packages that would emulate vim

It's terribly inefficient for emacs vi emulation mode to actually quit emacs when you type ":q", because it takes much longer for emacs to start up than vi, and people use a long-running emacs a lot differently than they use disposable vi's.

UniPress Emacs's vi emulation mode would actually flip you over to an emacs shell buffer when you typed :q, and the shell would recognize when you typed "vi foo.c" and flip back over to a vi emulator buffer instead of actually running vi, but INSTANTLY, since changing buffers in a running emacs was much faster than actually starting up a new vi process.

So die-hard vi users didn't have to re-learn their muscle memory, and could just stay in the same emacs all the time, while the same old emacs alternately flipped between pretending to be a shell, and pretending to be vi.

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#84

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 de…

What I observe is that most vim fans who swear by it use it as a bare bones editor, syntax highlighting at most. No auto-completion, go to definition or any other IDE stuff. Yes, it is possible to make vim IDE-like but very few do so.

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#85
post #6

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.

> 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?

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. :)

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#86
post #49

Earlier quoted context omitted.

Do you remember the time when every time you wanted to copy or paste something in a word processor you would dutifully hike your mouse up to the Edit button so you could select "Copy" or "Paste", and how when you learned that CTRL+C and CTRL+V was a thing your mind was blown with how much quicker it was? Vim gives you that experience, except times a gajillion because it not only speeds up what you already do in a WYS…

> powerful new tools to edit that have no WYSIWYG equivalent Can you give an example? I have heard this but I have difficulty understanding exactly what I could do in Vim that I couldn't do in Sublime Text for example

3

Shift+y

3

j

p

3

>>

time yourself doing the same thing in sublime.

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#88

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 de…

[deleted]

Re: Bill Joy's greatest gift to man – the vi editor (2003)

#90
post #21

Earlier quoted context omitted.

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

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.

nitpick: you seem to be talking about command-line mode; command mode is normal mode
Post reply on HN