News for hackers. Stuff that matters.
[dead]
Re:History of Emacs and vi Keys (2010) by sctb on Thursday May 18, 2017 @04:25PM (#14370791)
We don't need name-calling flamebait TL;DRs on Hacker News, please.

https://news.ycombinator.com/newsguidelines.html

Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @07:54PM (#14372012)
I genuinely consider falling into established patterns and modes of interaction (i.e. a cargo cult approach) to be a serious problem for software engineers, including myself. And I think that vi and emacs keybindings are a great point illustrating this problem.

But you are the boss, boss. Won't happen again.

Re:History of Emacs and vi Keys (2010) by sctb on Friday May 19, 2017 @04:11PM (#14378972)
Then please make your point without violating the guidelines. It's not trivial, especially when we feel strongly, but it's not hard.
Re:History of Emacs and vi Keys (2010) by epistasis on Thursday May 18, 2017 @12:37PM (#14368681)
Having caps lock where it is on current keyboards is in no way a superior design. It's a useless key in a prime location!

Give me those "inferior" keyboards any day.

Re:History of Emacs and vi Keys (2010) by jmfurlott on Thursday May 18, 2017 @12:54PM (#14368847)
Map it to ctrl and emacs is unstoppable :)
Re:History of Emacs and vi Keys (2010) by krylon on Thursday May 18, 2017 @02:58PM (#14370017)
Many years ago, I came across the term "emacs pinky". I thought it was joke, until I got a job as a programmer where I was lucky enough to have free choice of editor, so emacs it was.

My memory is a little hazy on the "when", but I think some 6-12 months after starting at that company, I noticed my left pinky did indeed kind of hurt. Reaching for that Ctrl-key on the far, far left front of the keyboard was getting a nuisance. The "emacs pinky" was real!

I did a bit of research on the Internet and found a piece of text that said, Ctrl used to be where CAPS LOCK lives now, oh, and here's how to make your CAPS LOCK into an additional Ctrl key (I cannot remember a single time I used CAPS LOCK, so I did not exactly miss it). I made the change and found it more comfortable right away.

To this day, the first thing I do on a new computer I am going to use for longer than, say, a week, is to make that little change. My pinky has not had any problems since.

Re:History of Emacs and vi Keys (2010) by FullyFunctional on Thursday May 18, 2017 @03:19PM (#14370220)
Indeed, the Emacs pinky got me started on a life-long interest in [ergonomic] keyboards. The best solution I have found so far is the Kinesis Advantage where Control is moved from the weakest finger (pinky) to the strongest (Thumb). I also swapped delete and Alt (Meta) so the thumb is use for Meta as well. Fixed all my problems!

Incidentally I _also_ switched to Dvorak too, but only for that keyboard. Works great because muscle memory "feels" the keyboard is different and uses the correct layout without cognitive overhead.

EDIT: typo

Re:History of Emacs and vi Keys (2010) by dragandj on Thursday May 18, 2017 @05:56PM (#14371451)
Move shift to spacebar (use spacebar for spaces also) and you're all set!
Re:History of Emacs and vi Keys (2010) by vlunkr on Thursday May 18, 2017 @03:10PM (#14370150)
I've started using my palm/the left side of my hand to press ctrl and it works really well, provided you are working on a keyboard with raised keys, not so easy on a laptop.
Re:History of Emacs and vi Keys (2010) by brudgers on Thursday May 18, 2017 @01:05PM (#14368953)
For me, symmetric C- and M- provides a good layout because I can use either hand for C- or M- and the other for the additional keypress. Having one on either side of the spacebar but asymmetricly located is ok, but not as good.

I have found that having only one C- key on the keyboard becomes uncomfortable over time. For example C-a and C-e and C-x and C-f contort my hand more with only a left hand C- key...looking for this in a keyboard is one of the things I learned from Xah's site.

Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @12:59PM (#14368891)
Yeah, C-n is just _perfect_ to reach. Just thinking of it makes my arm twitch and glow with pain. I am starting to suspect that Emacs original keybinding designer (Richard?) is actually an octopus.
Re:History of Emacs and vi Keys (2010) by brudgers on Thursday May 18, 2017 @01:09PM (#14368987)
He had a keyboard with important keys on both sides of the spacebar because the assumption was that a user would interact with the computer in sophisticated ways such as or similar to programming. Most current keyboards are designed for cost saving or consumption or just by copying mediocre designs that are common.
Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @01:48PM (#14369389)
I write software for 20 years, I use Linux and OS X as my primary development desktop OS, I have used Slackware Linux 1.0 back in 1995, I am a touch typist — but I just can't stay using Vim or Emacs, unless forced to (such as when I have to quickly edit something on a remote machine).

Yes, I might be a special snowflake — most developers don't have problems with vim or Emacs, expect for occasional flame wars between the two. But I do, even as I tried to make the switch like 20 or more times.

Re:History of Emacs and vi Keys (2010) by brudgers on Thursday May 18, 2017 @03:17PM (#14370209)
My comment was only to clarify that the keyboards have changed over the years and that historically, there was a more rational basis for the keybinding ergonomics than it might seem today. Part of the reason that Emacs is configurable is that there were lots of different keyboard layouts many years ago and the design view was that there is no one right way. One of the things I like about Emacs is that the philosophy of many right ways is consistent with mine and I don't think there is one right way of editing text and hence there is no one right text editor.

What I like about Emacs is that I can use it with just about any programming or semi-programming language I come across without having to learn a new IDE or editor. The other thing I like is that the capability ceiling of the tool is so high that I am constantly making significant progress in terms of efficiency. So the cost of learning it, was and is worth it for me. If I was writing Java or C# or Pharo most of the time, I'd probably uses different tools.

Re:History of Emacs and vi Keys (2010) by klibertp on Thursday May 18, 2017 @02:42PM (#14369868)
Why would you even try to make a switch to Emacs? It's kind of ok as a text editor, but, by default, it's nothing special. The default keybindings are stupid all the time they aren't malicious, that's true, and it has other problems, like archaic UIs (eg. completion, M-x, Speedbar).

The situation changes drastically once you account for two things:

1. The plugins. I said it many times already here on HN, but my Emacs is running 900k loc of Elisp, where more than 500k loc are plugins (or extensions, applications, and libraries). When modern packaging systems appeared, for both Emacs and Vim, their ecosystems were already formidable - it only got better since then.

2. Customization. It's not, in my opinion, worth learning Emacs if you're not going to customize it. The defaults are awful, that's one of the few things I agree with Xah on. But the ease of configuration and extension makes up for it if you're willing to put some hours into it. Not into "learning Emacs", but into "learning how to customize Emacs". The latter - if you're a programmer - is also more fun than memorizing arbitrary keybindings which don't necessarily make any sense for your keyboard, hand size and other factors.

It's, of course, a trade-off, as you have to put some effort into it and you're starting from a rather low point. You could try one of Emacs "starter kits", but, honestly, they involve just as much memorization as the vanilla version and (as mentioned) I don't find it fun at all.

Still, the smoothness of your workflow that you can achieve with Emacs once you do customize it is astonishing. It's still not pretty like VSCode (just one example I recently played with), but it doesn't have almost any limitations to what it can do with a single press of a key. It can make minutes or sometimes hours of your work time collapse into seconds (well, as long as you tell it how).

If you didn't already - if anything I wrote here is news to you - you could give Emacs another try. Of course, if you're not opposed to spending some time tinkering with it until it feels just right.

Re:History of Emacs and vi Keys (2010) by atilaneves on Thursday May 18, 2017 @02:31PM (#14369784)
I keep seeing this advice and don't understand it. Do most people not touch type? What am I supposed to do about right ctrl?
Re:History of Emacs and vi Keys (2010) by jorams on Thursday May 18, 2017 @02:54PM (#14369979)
In my experience yes, most people do touch type, and no, most people don't use right control much, if at all. The right control key on many keyboards is already so uncomfortable to reach that even single-hand chording with the left hand feels better. Using caps lock as the control key makes it even easier to completely avoid the right control key.

However, I have also seen mention of people remapping return to the right control key, then doing who knows that to still be able to press return.

Re:History of Emacs and vi Keys (2010) by brudgers on Thursday May 18, 2017 @11:06PM (#14372749)
The cheapest solution is the Microsoft Natural Ergonomic 4000 keyboard <$40 US with symmetric keys. For laptops, most Thinkpads have symmetric keys. Others, such as Dell Precisions have left and right control and alt keys, but they are not symmetric...better than one though.

Speaking of touch typing, the TrackPoint between g and h is also helpful. Thinkpads and Dell Precisions typically have one. Some Toshiba's also. Though this sort of assumes that keyboard is a primary driver for a laptop purchase.

Re:History of Emacs and vi Keys (2010) by epistasis on Thursday May 18, 2017 @02:44PM (#14369883)
I don't understand your questions. What would touch typing have to do with it?

And you can still use right control when typing a letter with the left hand. When pressing control-<right-hand-letter> you have less stretching. I've subconsciously over time found that I mostly do single-handed cording with control-<left-hand-letter> though since the control location is so much more convenient than the shift location (for me). Your milage may vary!

Re:History of Emacs and vi Keys (2010) by thomastjeffery on Thursday May 18, 2017 @11:17PM (#14372796)
While I certainly do touchtype, I never taught my right hand to contort itself to reach control or shift. I occasionally press right alt with my thumb, but that's about it.

Mapping caps to control makes my keyboard a bit more usable, but it is still fundamentally flawed in a variety of ways.

That is probably one of the reasons ergodox (or similar) is so appealing to me.

Re:History of Emacs and vi Keys (2010) by yarabarla on Thursday May 18, 2017 @10:39PM (#14372670)
I have it mapped to escape on a tap and ctrl on a long press. Vim and emacs :)
Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @12:56PM (#14368865)
I agree, modern keyboards are not perfect. But they are more intuitive and approachable than those monstrocities (I started with one of these — and when a modern Model M layout finally appeared, it was a pure bliss).
Re:History of Emacs and vi Keys (2010) by zck on Thursday May 18, 2017 @12:29PM (#14368613)
Do you have better designs? If you're using Emacs-style editing, you want Ctrl shortcuts. If you're using vi-style modal editing, you want single keys to move around. What would you recommend?

Note that moving your hand to the arrow keys is, while more intuitive, slower and requiring more thought than the other options presented (once these options are learned).

Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @12:54PM (#14368843)
Mac default keymap looks intuitive enough for me. Opt+arrows for skipping words, Cmd+arrows for sentences. Beats absolutely arbitrary Ctrl-A/Ctrl-E and ^/$ definitively.

(I am a proficient touch typist, but I can't adapt to hjkl in lieu of arrow keys — not to mention the context shifting overhead for two vim modes).

Re:History of Emacs and vi Keys (2010) by vlunkr on Thursday May 18, 2017 @01:10PM (#14369005)
Is holding down one or more modifiers and pressing a key not a similar context switch? Typing 'v' enters a 'v' character, cmd/ctrl-v pastes from the clipboard. There's no logical connection between the two except that you've probably had that one memorized for decades. The difference in vim is that you don't use modifiers when you're in normal mode (usually).

Side note: TWO vim modes? I guess you're never had the pleasure of stumbling into ex mode

Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @01:52PM (#14369420)
Two primary modes, you pedantic you.

Control keys are relegated to the edges of the keyboard and easily remembered and distinguished by touch, as there are only few of them. Cmd+X, Cmd+C and Cmd+V is much more convenient, memorizable and logical (X and V visually look like editing marks on paper, for cutting and inserting respectfully; C is for Copy), than... how do you copy-paste again in vim? v/y? I see no logic there. Yes, I remember that v is for "visual selection", and y is for "yank", whatever it is... but it is way less logical.

Re:History of Emacs and vi Keys (2010) by ursus_bonum on Thursday May 18, 2017 @06:02PM (#14371480)
This just in: "P" ruled totally illogical for "paste" "V" remains totally logical though of course
Re:History of Emacs and vi Keys (2010) by vlunkr on Thursday May 18, 2017 @03:05PM (#14370097)
*you pedant you
Re:History of Emacs and vi Keys (2010) by hxegon on Thursday May 18, 2017 @05:03PM (#14371069)
Just because you don't understand/like something doesn't make it illogical.
Re:History of Emacs and vi Keys (2010) by kps on Thursday May 18, 2017 @08:47PM (#14372259)
Yes, two modes: line and visual. The stuff between certain visual commands and ESC isn't a mode, it's a command argument.
Re:History of Emacs and vi Keys (2010) by kurtisc on Thursday May 18, 2017 @12:39PM (#14368708)
Remapping vi's escape function to caps lock or jj/jk seems like a common example, or doing it the other way around and getting a HHKB. It doesn't have to be a wholly different style, just one that fits modern keyboards.
Re:History of Emacs and vi Keys (2010) by falcolas on Thursday May 18, 2017 @12:49PM (#14368799)
Having used a HHKB, the arrow keys and page/home keys are aggravating to have to chord when you are in a program where you can't remap to the expected key combinations (and the chords all have to be done with just the right hand, unless you want to give up your CMD/Windows key).

The swap of del and '\' is annoying too, and creates problematic muscle memory that will fail you when you're forced to use a normal keyboard.

Re:History of Emacs and vi Keys (2010) by teddyh on Thursday May 18, 2017 @03:16PM (#14370194)
The Happy Hacking Keyboard Lite2 features real separate cursor keys:

http://www.pfu.fujitsu.com/hhkeyboard/leaflet/hairetu.html#l...

Re:History of Emacs and vi Keys (2010) by AlexandrB on Thursday May 18, 2017 @12:31PM (#14368636)
That's a bit of an oversimplification. Especially given how none of those keyboards look THAT different than what we use today. In particular, Vim's use of the home row for movement is objectively better than moving your hand off the home row and using the arrow keys (which you can do if you wish as well). I'm sure if someone was creating Vim today, they might choose WASD instead since many are familiar with the use of those keys for movement in gaming.
Re:History of Emacs and vi Keys (2010) by LanceH on Thursday May 18, 2017 @01:09PM (#14368990)
I would prefer they pick jkl; instead of hjkl. I'm not a fan of shifting my right hand left and even less enthused about forcing my index finger into double duty on jh.
Re:History of Emacs and vi Keys (2010) by chongli on Thursday May 18, 2017 @01:59PM (#14369487)
As a long time vi and vim user, I disagree. Learning the keys tends to happen in stages (with arrow keys being stage 1) and reliance on hjkl is not the final stage. When you truly master vi/vim you barely use hjkl at all. Instead, you use fFtT/?nN;, text objects, addresses, and marks. These tools allow you to move to places in text and make changes at a glance without dealing with all the characters or lines in between.
Re:History of Emacs and vi Keys (2010) by prewett on Thursday May 18, 2017 @11:10PM (#14372767)
For a long time I used h, -, return, and space. I had a hard time remember what j and k did, and those were a lot easier to remember.
Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @12:51PM (#14368813)
Key distinction: they didn't have arrow keys block. You can pry my arrow keys from my cold dead hands!
Re:History of Emacs and vi Keys (2010) by WorldMaker on Thursday May 18, 2017 @01:58PM (#14369474)
But you have to relocate your hand from the home row to use arrow keys. Arrow keys are great and all, but the vi/vim benefit to home row arrows is a lot less travel for your (usually) right hand, which can be a great ergonomic win.
Re:History of Emacs and vi Keys (2010) by arca_vorago on Thursday May 18, 2017 @02:03PM (#14369531)
I think the main difference between the vi(m)/emacs users and others is that they actually use the keyboard as their general home more. Not just programmers, but sysadmins, office workers, etc, spend far too much time in habit-formed inefficiencies of input.
Re:History of Emacs and vi Keys (2010) by tty7 on Thursday May 18, 2017 @12:31PM (#14368629)
One day i'll be able to downvote
Re:History of Emacs and vi Keys (2010) by atemerev on Thursday May 18, 2017 @01:01PM (#14368912)
...rationalizing cargo cultists.