Hacker News new | ask | show | jobs
by yulaow 4342 days ago
Usually the strong defenders of emacs tell you that you must use c-n c-p c-b c-f to move because those are better and you will adapt in a short time.

Then the strongest defenders of emacs tell you that you must use whatever you want because the purpose of emacs is that the editor must adapt to you and not the opposite.

3 comments

Actually I think the strongest defenders of emacs say you use C-s and the like for most navigation. Moving character-by-character is slow and inefficient, so the argument about whether C-n C-p etc. are better or worse than hjkl is irrelevant.

I have my own code editor which is more like vi than emacs, but I'm using interactive search in it.

I have my own code editor...

That's the best line I've heard to finish an emacs-vs-vi argument!

Well, sure, if by "finish" you mean "unite emacs partisans and vi aficionados in mutual and vaguely contemptuous pity".
Yes! C-s navigation, once learned, is the thing I miss most from other editors.
Agreed. Don't forget C-r too.
It's the vim defenders who will claim that the home key navigation is a must. Emacs advocates don't much care from what I've seen. Some of them will be roused to suggest that you learn to use searching better.
Vim defenders will also tell you to use search. Also, why would even Emacs fans recommended corded combos over single keypresses? Give my pinky a break man!
Because it means you don't have to jump in and out of different modes. The biggest thing that kept me from using vim was _constantly_ typing in normal mode and trying to issue commands in insert mode.

Is constantly hitting the Escape key (even remapped to Caps Lock, or using ^[) really any better on your pinky?

I use ^[, and I use my pinky a lot less than I would in emacs, because I do a lot more in command mode than I do in a single emacs chord. I view "insert some text" as its own command. Vim's commands are structured so you can combine orthogonal pieces, where emacs has a separate chord for everything.
Vim does the orthogonality thing better, I'll admit, but Emacs' separate chords tend to follow useful patterns, too.

For example, moving forward a character is C-f, moving forward a word is M-f, and moving a balanced expression forward is C-M-f. Same with b for backwards movement. C-a moves to the previous beginning-of-line, C-e to the next end-of-line. M-a and M-e do the same with statements in place of lines.

I can't even remember at this point how much of this is standard, but I've replicated the forward/backward movement for killing: C-d deletes a character forward, M-d kills a word, and C-M-d an expression. C-h deletes a character backward. Guess what M-h and C-M-h do.

Of course, both editors let you do basically whatever you want, so really the text input issue is just one of whether you prefer chording or modal input. And I'm not saying modal input isn't useful; Magit's input system is closer to vim's than to the rest of Emacs, as is Ediff's, and I like it that way, but I prefer chords for editing -- less state to hold in my head.

Sequential chords, though, like C-c C-v C-d, are right out, and using C-n and C-p and co. for up and down sucks, especially when I try to use M-p to select the last input in minibuffer history and hit M-o instead, prompting me to select Bold, Italic, or Other. I'll change them eventually; the hardest part is deciding what to replace them with.

/aimlessramble. I guess it all just boils down to "Use the tool you can best configure to work the way _you_ want it to." I think the linked article was trying to make the case that Emacs can be that tool for vim users.

It actually is. At least it's a "home-row pinky". However, I remapped esc to be "jk" to avoid the pinky abusing.

Now, if I ssh between different unix box a lot without the time to pull my .vimrc from github, then I still have to resort to pinky-escape.

At least it's a "home-row pinky" with Emacs' Ctrl, too. :)

Personally, though, I don't find the worst strain comes from the placement of Ctrl. The worst comes from the awful staggered layout of keyboards that serves no purpose save for a long chain of HCI backwards compatibility with the typewriter. I hope someday keyboards like the TEK (which, incidentally, gives a perfect spot for Alt or Ctrl under the left thumb) become more commonplace, or eye movement-based systems supplant the use of one's hands for focus control.

Hm, fair complaint. At some point I found that hitting ESC immediately after typing became habitual. I find myself accidentally doing it outside of vim quite frequently. I've heard others make similar statements to yours, though. If rebinding to a different key doesn't solve it, then modal editing may not be for you.
Real Vim Defenders™ tell you to use EasyMotion for the majority of your advanced movement needs.

In order of precedence: Standard vim movement -> EasyMotion -> Search.

There's like 70 different commands that can move the cursor in Vim. And that's before you add any plugins or mappings.
I'm a fan of C-n and C-p; I often find myself using them even in Sublime Text or other editors (even in a text area on a web page). But for some reason I find C-f and C-b much more obtuse. Part of it is that in a QWERTY layout, "f" is to the left of "b", and yet "f" moves the cursor to the right. Also, assuming you press Ctrl with your left hand, "f" is more natural to use with your left hand, while "b" is a bit of an awkward reach, making it natural to use the right. This left-right switch is awkward, especially combined with the aforementioned direction reverse.

On the other hand, C-a and C-k (especially in combination with each other) and C-e are incredibly useful, and once I discovered them I immediately started using them everywhere.