Hacker News new | past | comments | ask | show | jobs | submit login
History of Emacs & vi Keys (Keyboard Influence on Keybinding Design) (2010) (xahlee.info)
48 points by blacktulip on July 17, 2013 | hide | past | favorite | 45 comments

Interesting that a Xah Lee site has made it to the front page, most of his stuff had been totally banned on HN.

Ah well. The guy may be a strange individual but he's certainly done good in proliferating a ton of helpful documentation literature on *nix stuff.

His rants and trolls on comp.lang.lisp in the heyday of that group were epic... and annoying. He does seem to have matured somewhat.

The SysRq key is not so useless as the article would let you believe. Under Linux, it allows one to send commands to kernel to e.g. reboot the system [1].

[1]: https://en.wikipedia.org/wiki/Magic_SysRq_key

> Num Lock on the number keypad also is a relic

Using the numeric keypad as directional arrows can be more comfortable when gaming. I personally prefer to use it as arrows when gaming and numbers when working. I would not buy a keyboard lacking a Num Lock key.

It's especially useful as a left-handed gamer.

Right-handed gamers have the mouse on the right and use WASD for movement—and there's a comfortable distance between the two. Left-handed gamers have the mouse on the left—using WASD feels very cramped.

The benefit of using WASD for movement though is that there are a plethora of keys in its vicinity that can be remapped. With the numpad, not so much.

My keyboard has no 'lock' keys and I can't say I miss them (I don't recall using any of them intentionally, ever).

I can understand the keypad being more comfortable for certain games, but it's an edge case.

A lot of older games would map the numbers 2/4/6/8 as aliases for the arrow keys, so it'd work regardless of what position the numlock was in. Seems to have gotten less common.

Quake 1 did this, iirc. From what I remember, game studios around that time played around with different bindings, but generally stuck with keyboard only bindings by default, because mouse+keyboard was still considered an "advanced user" technique. For the most part, game makers adapted to how the users were playing (WASD) rather than setting a standard and expecting users to follow.

> ... vi's {H J K L} is still pretty good, but better is {I J K L}...

You've got some nerve, guy.

Moving off the home keys is nothing short of awful. After 15 years of using vi daily (but not as my primary editor) I still can't switch to it for just this reason.

IJKL doesn't move you off the home keys though.

I do wish that it had been 'JKL;' instead of 'HJKL'. Pulling my fingers from their resting position has always bothered me.

The ; default binding is very usefull in navigation too.

Anyhow you shouldn't need `h` often.. Using b, F, T, ge, gE, ^, 0 is much faster.

I wish it had been ijkl, just like gamers use wasd.

or 'ASDF'.

Using this to bring up something related, which I have always wondered: How do you orient your hands when performing ⌘+Z/X/C when using a Mac keyboard? Which finger presses the ⌘?

Having used Windows as a child and Linux for many years since, I'm sure a large part is "you get used to whatever you use". However, any time I borrow a friend's Apple laptop to demonstrate something, I always waste a few cycles thinking about just how I should really be dealing with the keyboard, and never really settle on an answer.

At its core, I love the idea of the ⌘ key: Something for shortcuts in GUI applications so that Ctrl can remain for sending Unix Signals. But it's position, combined with the lack of discrete Home, End, PgUp, or PgDn, is a majority of what keeps me from buying a Macintosh laptop. Also the whole function key deal. The keyboard is such an important source of my productivity.

I tend to just thumb it (the left side one, I only tend to use the right one for the command-delete trash shortcut), same as I do with alt- shortcuts on Windows layout keyboards. I find the mental shift from using command on OS X to Ctrl on Windows pretty easy to do, but then I spend a lot of time on both platforms.

One of the things I find quite difficult to mentally adapt to when switching is the behaviour of the Enter key, since in Windows it is open, and in OS X it is rename (which I find much more useful, since you can command-down arrow to open which is used for folder navigation with command-up for opening the parent folder).

There are a bunch of little-advertised command key shortcuts for Home, PgUp, etc too, so you figure out a way to make it work pretty quickly (some work inconsistently though, I tend to mainly use the word/line based stuff rather than page/document). See http://ss64.com/osx/syntax-keyboard.html .

>One of the things I find quite difficult to mentally adapt to when switching is the behaviour of the Enter key, since in Windows it is open, and in OS X it is rename (which I find much more useful, since you can command-down arrow to open which is used for folder navigation with command-up for opening the parent folder).

For future reference, you can rename in Windows/Linux using F2. Works in Windows Explorer, and in most Linux file browsers that I have tried, though who could ever claim to have used them all? ;)

As for [Modifier]+Down to enter a folder, that makes a lot of sense and I like it. The last time I used a Windows machine (Win7 I think), I noticed that they had finally adopted Alt+Arrow navigation in Explorer. Alt+Up goes to the parent folder, same as Linux (and OS X it seems!), and Alt+Left/Right goes backward/forward in folder history. I'll probably try and add Alt+Down to one of my Linux file managers sometime, because it makes much more sense than having to switch to Enter for going into something, and Alt+Up to go back out.

Thanks for that, I didn't know about Alt-Up (and had always been annoyed at the removing of the parent directory button in Win7). F2 is one I'll have to remember too. Context menus and click-pause-clicks are annoying.

I was just perusing that link, and my god you have just saved me so much frustration. The shortcut:

⌘+` Switch between document Windows in current application

Solves the single most confusing thing I have dealt with on OS X! By happenstance of populations, almost none of the Mac-owners I interact with are power users of any sort (programmer, accountant, etc.). When using their keyboards and fumbling around like an idiot, I always ask "How do I go to the other window of Chrome?" or similar, and they don't know what I mean. I have Googled for this before, but could never figure out how to phrase the action to get an answer.

If I could reduce my karma just to be able to increase yours more than one for this comment, I would. Thank you very much.

This doesn't work for me in Chrome (28.0.1500.71). Other apps work fine. Is there something that needs to be done to get it to work?

I, and all OS X users I know, use the thumb to press command. I rarely need to use home/end, since control-A and control-E work in all text fields. PgUp and PgDn are fn+up/fn+down, but I never use those.

>I rarely need to use home/end, since control-A and control-E work in all text fields.

Interesting. If I can remember that and keep it in mind, I'll be far less jumpy and clunky next time I'm typing on a Mac. Thanks!

On the note of PgUp and PgDn, I suppose I mostly use them for tab navigation: Ctrl+PgUp and Ctrl+PgDn works as a "Next Tab" and "Previous Tab" in pretty much every tabbed Linux application I've used. I recall it being almost universal in Windows as well. Is there an OS X equivalent shortcut for Next/Prev Tab?

Command-shift and square brackets seems to be pretty common (well, it works in Terminal and Chrome, so there's about 80% of my usage there).

Ctrl+Tab and Ctrl+Shift+Tab work as next/previous tab in Safari, Firefox and Chrome.

I remember using an older mac laptop and the keyboad was hard up against the screen with small function keys. Any time I wanted to use one, I'd bang my fingers against the bezel.

Thanks, I enjoyed that ;-)

Thumb, and incidentally, mine is remapped to Alt/Meta for better Emacs support. I'm not a big fan of the Apple key layout either, but the reason I use an Apple keyboard with Emacs in Cygwin is that it just feels right. Maybe it's because I've been using laptops for such a long time, but something about the pitch and the tactile feedback just seems to hit a sweet spot. Plus, I guess compared with the other HP, Dell and Logitech crap we have around the lab, it's probably the best option (at least for me).

You can make it so that F-keys are F-keys by default, and the other actions require Fn. It's in the settings.

On the Mac, the Ctrl key can be used for Home and End using the Emacs/bash keys (Ctrl-A, Ctrl-E).

I'm also a thumber.

Huh. Odd that he reckons IJKL would be better for vim keys considering you'd have to use the same finger for up and down, while using HJKL you can use different fingers for up and down as well as left and right.

here's what i think. in both ijkl and hjkl, you have one finger doing 2 keys. In vi, it's pointing finger doing hj, moving side ways. In ijkl, it's middle finger doing up down. So i think ijkl is slightly better. I remember seeing similar analysis on coleman forum.

I see what you mean about the 1 finger 2 keys bit, but I find I tend to either be moving up and down lines or left and right in a line. With HJKL I'm then using two separate fingers for navigation horizontally and vertically. If I used IJKL I'd be using a single finger when moving vertically and two fingers horizontally.

I'm curious as to what people who spend more time in vim than I do think about that. Personally it seems more comfortable to be using different fingers rather than shifting when going up/down.

I'm not a vi user, but wouldn't you shift your hand one key to the left when navigating?

Yeah, he doesn't really present any logic for that, either. As if he's starting from the discrete arrow keys and making an assumption that this is an optimal placement. I remember struggling with up/down on arrow keys as a child, thinking it should be more like a cross, with a space between down and up, or with the left/right keys centered on the gap between up and down.

Edit: Echoing asdfs's comment elsewhere in the thread, I think that jkl; would be an alternative with actual, arguable benefits.

Put your ring finger in the gap between your I and K keys. To press one or the other, you don't have to relocate it, you just roll it in one direction or the other. It's similar to the technique of hitting any of the XABY buttons on an Xbox controller with the side of your right thumb while keeping the end of your thumb on the analog stick.

And in any case, when was the last time you moved up and down at the same time?

If you touch-type you use the same finger for j and h.

Sorry, I wasn't being clear.

Using HJKL: Navigating vertically is index finger on J, middle finger on K. Navigating horizontally is index finger on H, ring finger on L.

Using IJKL: Navigating vertically is middle finger on I for up, middle finger on K for down, so using the same finger and shifting keys when you need to change direction. Horizontal would be the same as HJKL.

This is what strikes me as odd about the cursor key layout: When changing direction vertically you have to physically change the position of your finger. With the vim (trying to resist calling it 'roguelike' :P) layout you're only moving your fingers when you're switching between vertical and horizontal.

I'm not sure why this bothers me as much as it does :/

Going up and to the left is far more common for me than needing to go up and down at the same time.

That vi keyboard is bleeding minimalism in constrast to the lisp keyboard.

Yep, and notice where the ctrl is. I just mapped my caps lock to control a few days ago (mac os makes it super easy to do this), and I love it. I should have done it friggin ages ago.

I also started using the leader key (\) in vim, another thing long overdue. That's in an easy location on that old keyboard too.

I rarely use the CTRL key in vim and unfortunately my CAPSLOCK key is bound to SUPER for easy tag switching in awesome-wm. I think I am missing on some of vim's core features because of that. I already saw huge improvements when switching to US-International layout and it smoothed things in vim too.

Free tip:

    ~ $ echo 'imap jj <ESC>' >> .vimrc
jj being a rare combination in insert mode it makes a nice pinky-safe ESC move.

What annoys me is keyboards that don't have a pause music button, but have a pause button that does precisely nothing.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact