Hacker News new | ask | show | jobs
by dilap 5595 days ago
I dunno, I'm a longtime emacs user/addict, and I get the feeling that its actual editing commands just aren't that well thought out -- because of this, I've flirted with trying to use vim and vimpulse (an emacs vim emulator), but it's super-hard to get away from emacs once you're used to it...

I'd be interested to hear if anyone else has moved from emacs to vim. (Or thoughts of people who've gone the other way.)

2 comments

I dunno, I tend to prefer the emacs movement keys over vim. I-search to move around in emacs, in combination with C+A+f/b is (usually) fairly fast - though a fairly good reason for that might be because I know the structure of what I edit. As for someone who moved from emacs to vim, I cannot resist posting this particular link :)

http://notinventedhe.re/on/2010-12-22

Well, I could be wrong, but it's just a sneaking feeling that vim might be faster. But I've never been able to stick w/ it long enough to know for sure....

But e.g., stuff like "." the e/E and b/B distinction, [d]f (like zap-to-char but waaay more useful) don't really have emacs equivalents.

And come on, C-f, C-b, C-n, C-p to move around -- not smart! I assume it's for "forward, backward, next, previous", but you shouldn't choose your most basic motion keys to have memorable names, you should choose them to be efficient!

In emacs, repeat is C-x z, and then keep pressing z. (C-x zzzzzzzzzzzz...)

While M-f, M-b are e and b, I don't know of an exact equivalent for E and B. But they could very easily be added.

IMHO, basic editing in Emacs has slightly higher constant factors (mostly due to typing the modifier keys), but scales much better as operations become more complex.

Cool tip about C-x z, buuut... Playing with it a little bit, it doesn't seem to fit so well with a non-modal editor, because "last command" ends up being more like "last keystroke". E.g., if I write "I like cats" and then hit "C-x z", it enters..."s". Probably a more practical emacs equivalent is to just quickly record and replay a macro.

As for adding equivalents to E and B, sure, but what keys do you bind 'em to? Either unwieldy C-c FOO combinations, or spend the rest of forever playing whack-a-mole with various modes that happen to have already defined the keys you wanted to use. While emacs is infinitely customizable, the baseline editing functionality that everything expects is important -- otherwise you're just fighting against the grain. Though the various vim emulation modes have made a heroic effort...

It would be interesting if something like that vim keystroke competition could be expanded to include emacs as well. >:)

The repeat has different granularity. I prefer Emacs's, but, matter of taste I guess.

"Super"-f/b are free on my keyboard, where "super" is the button with the Windows logo on it. I don't really miss the E/B functionality, though, and I used vim for about five years before I started using Emacs.

Ah, I was wondering how much vim experience you had. Quite a bit! Well, thanks for being an interesting data point. :)

(BTW/FWIW, I'm on mac and keep the option key as command, so no extra key lying around for me to use as super.)

Vim is definitely faster at starting up ;)

For "." you could say that C+k,C+_/C+y does most of what I want done -- and arguably, the more complex cases might be amenable to using regexp-replace.

Regretfully, the only time I ever use hjkl is to play crawl :) The emacs keys are perhaps more geared towards using modifiers, with M-f/M-b + C-f/C-b serving as the closest replacements for movement, and M-z for zap-to-char.

Faster startup ain't nothing! I'm religious about making my .emacs only load modules on demand (using autoload and eval-after-load -- lisp is a great editor customization language, actually), and have managed to get emacs down to 250ms:

  gin17 ~ $ time emacs --eval '(save-buffers-kill-emacs)'
  real	0m0.256s
But that's still a lot slower than instant, which is where vim is:

  gin17 ~ $ time vim --cmd :q
  real	0m0.006s
I definitely don't feel that emacs editing is bad, and I use and appreciate one-off macros, [regexp-]-isearch-and-replace, and killing and yanking (the kill ring is awesome), but...I think the grass might be greener.

Well, after all this discussion, I'm probably morally obligated to spend more time with vim (or maybe vimpulse) so that I actually know what I'm talking about. :)

and I get the feeling that its actual editing commands just aren't that well thought out

If only it had some way you could customize it, eh? ;)

Yeah yeah yeah, emacs is infinitely customizable :) (and you can even emulate vim), but...this doesn't work out as well as you might like in practice 'cuz there tends to be a lot of friction with various modes that weren't expecting your customizations.

Plus, I'm already not sure if the time I save in emacs is worth the time I lose fiddling with it ;)