Live data from Hacker News

Why, oh WHY, do those #?@! nutheads use vi?

viemu.com

41–50 of 53 posts

Re: Why, oh WHY, do those #?@! nutheads use vi?

#41

This article is excellent. I'm an emacs user, and I know of several articles and books that introduce emacs, but this is the first time that I've ever actually understood how a vi master thinks.

Wow, the '.' is certainly an enviable feature. http://meghnad.iucaa.ernet.in/intranet/sysadm/help_desk/emac... isn't reassuring either. How does C-x (, C-x ), and C-x e compare? http://linuxgazette.net/issue47/pedersen.html

Esc-Meta-Alt-Ctrl-Shift ;-)

I started out in Emacs, made the leap to XEmacs, learned to write elisp, then one day I discovered that Vim syntax highlighting was pretty damn good too... it was all over.

Vim + Screen == Real Ultimate Power

Re: Why, oh WHY, do those #?@! nutheads use vi?

#42
post #7

Earlier quoted context omitted.

Man, I agree with the notion of power, but I simply cannot see how anyone could call it simple. The array of keystrokes and their combined meanings is not anywhere near simple, in my opinion. That said, I would really like to sit down and learn vi sometime.

about the longest 'combos' you make are action-move combos, which is 2 keys, and both the actions and move keys do things by themselves. 'w' for example moves to the beginning of the next word. it's a common travel key. 'dd' deletes the current line and is also commonly used. combine them into 'dw' and you delete everything up to the front of next word so you preface any motion command with an action and you get the…

My longest day-to-day combo is "vabx" or "vaby". Basically, for lisp code, it selects the entire s-expression including the parens, and either removes it or deletes it.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#43
post #19
post #7

Earlier quoted context omitted.

about the longest 'combos' you make are action-move combos, which is 2 keys, and both the actions and move keys do things by themselves. 'w' for example moves to the beginning of the next word. it's a common travel key. 'dd' deletes the current line and is also commonly used. combine them into 'dw' and you delete everything up to the front of next word so you preface any motion command with an action and you get the…

> about the longest 'combos' you make are action-move combos, And then you use :wq as your finishing move!

:x is the same as :wq, so for those who don't like q's, you can save your pinky.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#44
post #24

Earlier quoted context omitted.

As I say, I do love the power of it and I'm sure I'd find it somewhat intuitive once I start using it, but it's just a steep learning curve when you can't fall back to input with a mouse. What I mean is: whenever I start learning a new program, I like to be able to use it like a n00b at first (i.e. click around, use native controls), and then learn the more powerful features. A good example of this way of learning is…

Interesting perspective, I'm wondering if you're a "Gen Y'er" (or whatever they're calling that newfangled generation these days ;) I ask because I started with PCs before the mouse was really commercialized. My first programs were on Commodore PETs and C64 and my PCjr. (Although I did later buy a mouse for the PCjr, I think it cost close to $200 at Babbages, had to save money for a while for that one...) My long-win…

I'm wondering if you're a "Gen Y'er" (or whatever they're calling that newfangled generation these days ;)

Apparently the defining starting birth year for that generation is 1982. I happen to have been born that year, and my preferred term for the generation is "Millennials". "Gen Y" over-emphasizes our interaction with the "slacker generation" which preceded us.

Anyway, I don't think that there's much correlation between birth year and vi. With the rise to prominence of Linux and other Unix systems many many budding hackers are starting out with full-fledged command lines and honest-to-goodness Unix. And that's a beautiful thing.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#46
post #27
post #9

Confession: I use vi because when I was learning how to be a sysadmin (was already a coder) it was recommended -- back then (the '90s) you never knew if emacs was going to be on a system, but vi was practically guaranteed. I still barely know how to use it, though: my own fault. Laziness prevails. Some of the commands I use because I discovered them by accident (shift-C erases the rest of the line and puts you into e…

Does this mean that nowadays you can expect emacs to be installed on every system? From what I've seen, still no. So basic vi skills are still needed. But nowadays, there are many ways to avoid having to edit files with vi. If a system has sftp access you can mount it's file system via sshfs and edit files from your main machine in emacs. This way you could even have the files version controlled on your main machine.…

When you really need vi, you really need it. I'm talking about connecting to servers halfway around the world with the only access being via a serial connection. Straight-up serial console, none of this fancy newfangled terminal emulator nonsense. No amount of emacs and sshfs will help you then.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#47

This article is excellent. I'm an emacs user, and I know of several articles and books that introduce emacs, but this is the first time that I've ever actually understood how a vi master thinks.

Wow, the '.' is certainly an enviable feature. http://meghnad.iucaa.ernet.in/intranet/sysadm/help_desk/emac... isn't reassuring either. How does C-x (, C-x ), and C-x e compare? http://linuxgazette.net/issue47/pedersen.html

The emacs macro features compare pretty well. They're a killer feature of emacs. The editor is named after macros, after all.

You can probably accomplish much of what vi's "." does using emacs macros. The trick is that in emacs you have to notice the opportunity slightly in advance, so that you can hit 'C-x (' and then plan out your macro so that it plays back well on subsequent invocations. You could probably train yourself to think of that more often, after which your emacs experience might be roughly similar to that of the vi user.

But I suspect that vi is better designed for such a macro-intensive style of editing. The beauty of "." appears to be that vi workflow naturally divides into little chunks of action, each of which can then be treated post facto as a macro. This explains my #1 pet peeve as a completely ignorant vi user -- that vi is so damned choppy, always switching in and out of insert mode. That's not a bug, it's a feature! Those little transitions are the waypoints that will later be used to break your workstream into repeatable chunks.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#48
post #35
post #21

I switched to vim for a few reasons: - I didn't want to get trapped into being comfortable with some editor that I would later not have access to. vim will always be there on any unix box - there are no showstoppers for vim. Every other editor is great because it has x and y, but the lack of z is annoying. with vim, you can configure it to do almost anything with macros in your .vimrc - it was slow to get going at fi…

vi might be on any unix box, but not vim.

That's true. I'm working on FreeBSD support in our products right now, and every time I type "vi filename", I either get frustrated as hell for the few bits of typing I have to do, or I notice immediately and :q and "vim filename" to get the right thing. Since I'm spawning new instances for each testing cycle (I'm building a product installer) it's a bit of a nuisance to make an alias each time. The default csh shell also pisses me off.

Re: Why, oh WHY, do those #?@! nutheads use vi?

#49
post #4

Being a dedicated emacs user, I could only shake my head and sigh as I read this.

The first step is admitting you have a problem. You're on the right track.

I would love to get into a lengthy discussion about why the One True Editor is superior to vi, but I have a feeling that it would just degenerate into a flame war. vi does have an advantage in that it comes standard on most unix servers, while emacs requires a long (but relatively painless) install.

Let's just say that in terms of power the two are about equal. I think emacs has an edge in the macros/functions department but vi isn't far behind. It's probably also fair to say that either one of them are probably better than a Windows based IDE if you're working with open source software (ruby, php, perl etc).

Re: Why, oh WHY, do those #?@! nutheads use vi?

#50
post #4

Being a dedicated emacs user, I could only shake my head and sigh as I read this.

The first step is admitting you have a problem. You're on the right track.

I left vi(m) behind over a year ago, so I'm not sure what you're getting at here. ;)
Post reply on HN