5 ms·
> A very trivial example is the fact that most IDEs don’t even have keybindings optimized for touch typing - they require you to move your hands often from the
by aufreak3 15y ago
> A very trivial example is the fact that most IDEs don’t even have keybindings optimized for touch typing - they require you to move your hands often from the home row (such a waste) and have mouse-centric UIs.
what? ... and Emacs has optimized key bindings for touch typing? C-x C-c!
Personal notes here - I know emacs-vs-vim is war, but I'm interested in the cognitive aspects of why one works for some people and why another works for others.
My own preference - vim - is driven by memorability of commands. Though I used to use emacs for a long time, remembering commands was a problem for me.
When I tried vim, I found many of the commands I need frequently to be memorable because they are compositional.
Here is what I mean - if I learn the concepts "delete = d", "change = c", "copy(yank) = y", "in = i" and "around = a", I can construct "delete around (" = "da(", "yank block" = "yank around {" = "ya{", "change array contents" = "change inside [" = "ci[" and so on.
So do long time emacs users just remember the keystrokes or have some kind of logic like that for them?
edit: I know emacs is much more than that, but my usability question is purely about the keyboard interface.
- rdtsc 15y ago> what? ... and Emacs has optimized key bindings for touch typing? C-x C-c! I can type C-x C-c faster than switching to a new "mode" or moving the mouse pointer anywhere. As for memorability of commands, I really remember them using my finger motor memory. If you are stopping to think for what the command is before using, might as well start moving the mouse. The question is then, how does one get to that point? And that what you are pointing out I guess, when learning, it is hard to remember. The trick though is to do it, step by step. If you just know how to save and quit the program you can use the editor in a very basic way. Use arrows, and type. Then you can learn commands as you go along.
- jamesbritt 15y agoIf you are stopping to think for what the command is before using, might as well start moving the mouse. No, because over time you will pause less often, and for less time, until it becomes automatic.
- rdtsc 15y agoThat is true initially, and one has to go through that process. But eventually it reaches a point when it is automatic and then the ease of memorizing the command doesn't matter (provided the person stuck with it and didn't decide it was too much of a pain to learn).
- jasomill 15y agoThis seems to depend on the nature of the command --- "move to the word I'm looking at" is often faster with a pointing device (though I haven't regularly used a _mouse_ in years, I use a trackpad on the left and a digitizer tablet on the right). For most other text-related commands one uses often, I'd agree (though I've never used a stopwatch to test it, and "the easiest person to fool" is often one's self in these sorts of "efficiency" contests --- perception can mislead).
- jamesbritt 15y agoprovided the person stuck with it and didn't decide it was too much of a pain to learn That's the key. If I can pause for a second and typically deduce the correct action I'm more likely to stick to something than if I typically have to pull up a help file to know what to do.
- wahnfrieden 15y agoI don't know emacs, but I'm guessing C-x C-c can be done in 3 keystrokes and that it saves. In vim, I save in 3 keystrokes too: ;w<CR> (I have ; remapped to : since it's so common). Of course I could remap a shorter combination to save too, and without having to switch modes.
- mturmon 15y agoC-x C-c in standard bindings quits Emacs. I think the first reply above (aufrek3) was making a joke.
- scottjad 15y ago> Here is what I mean - if I learn the concepts "delete = d", "change = c", "copy(yank) = y", "in = i" and "around = a", I can construct "delete around (" = "da(", "yank block" = "yank around {" = "ya{", "change array contents" = "change inside [" = "ci[" and so on. Vim is super cool in how it lets you combine commands. There's nothing quite like it in emacs. Emacs generally takes a more interactive approach, where each part is a separate command that can be interactively repeated. It's left to the user to combine them either by recording (and saving) a macro or by taking the function names for the commands and writing their own command. Emacs is rarely fewer keystrokes by default. For people who like vim editing commands there's viper, vimpulse, and evil. da( = C-r ( RET C-w My C-w is customized to cut the appropriate thing at point if there's no region. Without that you'd need a C-M-SPC before C-w I would often do C-M-u repeatedly as it would cycle me through [, (, and {. ya{ = C-r { RET M-w Again I'd normally use C-M-u instead of C-r {, but if you know you want a { this is better. The difference between emacs and vim approach is clear here. Emacs separates the things and makes each step interactive, so you don't have to think before hand how many { are between cursor and where you want to start yank. ci[ = C-M-9 C-k C-M-9 is my custom which goes inside [, (, or {. C-k is is paredit's kill, which goes to closing item instead of end of line.
- aufreak3 15y agoAha! I think I see the difference now. It's (in all earnestness, I swear) the difference between OOP and FP. Vim is verb-first and emacs is noun first :D My vim preference correlates with my language preference. How about yours? Do you prefer OOP languages? (this is just preference I'm talking about, not superiority of any sort. I read this somewhere - "talking about object oriented programming is like talking about pants oriented clothing". I concur.)
- nyellin 15y agoUse vim's visual mode when the noun is uncertain. Or just select the smallest possible block and . repeat.
- yoklov 15y agoThat's an interesting observation, and I'm glad I'm not the only one who has thought this. From what I've seen (as an emacs user, and a functional programmer), typically people in the FP camp tend to use emacs, and people in the imperative camp tend to use Vim. (Aside: Really, most of the people I know use IDE's these days, even if they are a vim or emacs user. The FP guys are the only ones who don't, to be honest, and that's mostly due to a lack of IDE's for functional programming languages.) Something I've thought was that Vim was for the most efficient possible editing of text data, whereas emacs was not concerned with efficiency so much as ability to edit _structured_ data. Emacs' paredit-mode is a great example of this. Should you be unfamiliar, paredit _prevents_ you from creating an unbalanced parenthetical structure in your code. For example, if you have (Harpo (|Groucho Zeppo)), where the | is the cursor, pressing delete does nothing! Instead, I should press M-s for paredit-splice-sexp (I think), which will result in (Harpo Groucho Zeppo). The structure is more important to your text editor here than your ability to edit the text. Vim, on the other hand, lets you drive unsafely. It lets you make your own speed limit (metaphorically, more than literally. emacs and vim are both quite fast methods of editing once you get used to them, I do think vim is faster though). It wouldn't ever do something like prevent you from deleting a paren just because it would cause an imbalance on the page. Object Oriented and imperative languages, C++ in particular, have always seemed the same way to me. They do what you say, and don't question the soundness behind it's logic. I have a lot respect for people who can code like that, because I can't. I like my text editor or my programming language telling me when I'm being a fool. Sorry for the long and somewhat off-topic post, it's a subject I've given a great deal of though to in the past and it sprung forth from my mind onto the page before I could stop it ;)
- neutronicus 15y agoIt's pretty much muscle memory for me. I tried to learn vim for a while after a particularly bad bout of emacs pinky, but I couldn't get any of <whatever vim has instead of major modes> to work, and that was pretty much a non-starter.
- naner 15y agoSo do long time emacs users just remember the keystrokes or have some kind of logic like that for them? A bit of both. There is muscle memory of course, but they attempted to lay out the default key bindings logically: Ctrl-k is "kill" and Ctrl-y is "yank", Ctrl-h is the "help" prefix so Ctrl-h k brings up the "help" for a specific "key" binding and Ctrl-h f brings up the "help" for a specific emacs "function". Ctrl-a goes to the beginning of a line (a is at the beginning of the alphabet...) and Ctrl-e goes to the "end" of the line. Alt-a and Alt-e go to the beginning and end of a paragraph. Ctrl-b goes "back" one char at a time, Alt-b goes "back" one word at a time. Ctrl-f and Alt-f go "forward" by one char/word. Etc.
- tincholio 15y ago>what? ... and Emacs has optimized key bindings for touch typing? C-x C-c! Pretty much, yeah. You just need to have CTRL in a sane position (hint: CAPS LOCK). If on a Mac, also make sure Emacs sees your CMD key as META, and you're a go. No need to move your hands from the home row for 99% of the stuff you need to do.