It seems more the case that the designers of that computer chose those particular keys on the basis of a desire for efficiency that vi also followed, so there was no need to create a new convention.
How does the author's "That's the whole story!" ending make you feel like he's saying hjkl being used as the navigation keys was a coincidence?
If you make a serious commitment to vi(m) though, binding your capslock to esc is probably the better way to go.
[Edit:] or at least that's what I thought, wavetossed's comment below provides interesting insight.
The thing about ASCII Control characters doesn't quite map to left-up-down-right, and even if it were part of the answer, we could ask again: why were those characters chosen for those control-roles?
8 H backspace
9 I tab (right a lot)
10 J line feed (down)
11 K vertical tab (down a lot)
12 L form feed (down a page)
13 M carriage return (left a line)
Seriously though, I think with a tiny bit of key-swapping in the vimrc, you can use dvorak or colemak just fine.
I have a qwerty guest keyboard next to my Kinesis Advantage. Also dvorak isn't necessarily that faster, but rather more comfortable.
This explanation of the origin hjkl is the first one to satisfy me. Now I can see the others, not as explanations as to why it is, but explanations as to why it stuck.
https://bitbucket.org/cheater/us_split/overview
I see a lot of people in the comments talk about vim's "weird" layout choices. I suggest in your OS you change caps lock to esc; and that in vim you remap ; to : and : to ; in order to stop having to press shift every time. You can then really start doing the whole home row thing; IMO it's impossible without those two crucial settings.
Here[2] is a photo of my keyboard. The coloured keys are sold as WASD/escape keys but I used them for playing Skyrim - the green one on the right is especially handy for gaming as i don't have my fingers on the home row when playing games rather than typing. The blurred circuit board is a development version of the Midifighter 3D[3] as the photo was taken before they were announced.
[1] http://www.daskeyboard.com/model-s-ultimate-silent/
[2] https://plus.google.com/u/0/photos/100355674716107842386/albums/posts/5676123139988463922
[3] http://www.djtechtools.com/2012/02/27/introducing-the-midi-fighter-3d/
I've been really satisfied with it, and would definitely recommend it to anybody looking for a nice mechanical keyboard.
Well, mine is quieter than other keyboards I've used, eg a Dell keyboard[1] as long as you don't bottom the keys out, though I do get the occasional loudish click when the keys snap back, usually from the space bar, though if I slow down when typing I can make it almost completely silent (obviously thats not normal typing though).
[1] I did have a Saitek eclipse a few years ago that was quieter.
Mostly keep my vim key-binding mappings small, so I'm not confused when working with it with default settings. Mostly use <Ctrl>-c to get out of insert mode though, escape is so far.
The only thing I wish is that the keys were in a flat grid rather than staggered, but it seems very very hard to find any keyboard like that, so no biggy. I've considered getting a Kinesis for years now too, but since I got the DAS, I've had no plans of switching any time soon.
I haven't completely worked out my vim bindings since I've been doing a lot of Qt development in QtCreator lately and just used that without vi mode. I use Colemak for my layout so some of the default keys are a little less than optimal, but I also don't want to change them too much. With one or two simple key swaps it seems quite usable though.
On windows (where I don't use vim) I did map alt-gr to some common programmer symbols; mapped caps lock to control and control to backspace. On my laptop I use vanilla colemak though (including caps lock as backspace, though I'm likely going to change that some time).
They have tons of choices of blue, black, and brown Cherry switches (I think), you just have to match up their terminology with the right color.
They ship from England too, fyi.
If you're looking for a good place that does boot shaped enter keyboards then you can use Unicomp's Model M. You can rearrange the keys as you wish and they'll even print key caps with anything you want on them with the home row indicator tab, so you can put one on the h key.
The only problem with your layout that I see is the right shift key -- you lose a key because it's covered by two fingers. I'm definitely going to give it a try.
This is a bit of a compromise, but all the other programs that are not vim will benefit from it.
Although personally I type in Colemak, I still use this, just with 'yy' instead. To be honest, it's a barely noticeable slow-down but it's much less stressful for my hands.
There are really a lot of ways to do this. See: http://vim.wikia.com/wiki/Avoid_the_escape_key
I wonder how Dijkstra would react to that statement.
I use ^[ to end insert mode.
This only happens when you use macros like I do. I took a look at my registers and here's a random one I did four months ago (using Surround.vim to wrap an indented area in div tags).
V/^[ ]\{0,2}[^ ]/-1^MS<div class="question"^M
I picked that up a few years back playing World of Warcraft and some other games, to avoid having to move my left hand away from WASD as much as possible, but it has served me very well in a lot of other applications since then.
Edit: Well, that was supposed to be an answer to cheatercheater below this comment. Woops.
The reason that keyboard had those arrows keys on it was because those keys correspond to CTRL-H, J, K, L and the CTRL key back then worked by killing bit 6 (and bit 5) of the characters being typed.
The effect was that H which is ASCII 0x48 would become 0x08 which is backspace. If you look at an ASCII table (e.g. http://www.asciitable.com/) you will notice how the uppercase ASCII letters line up nicely with the control characters so that just dropping bit 6 will get you there. Same thing with the lowercase (drop bits 5 and 6) and you are on the control characters.
The CTRL-H, J, K, L therefore correspond to BS, LF, VT, FF. BS is backspace (i.e. left), LF (down), VT is vertical tab (so up) and FF is form feed (which in this case takes you up). I'm not sure why FF was used for up.
This is also why CTRL-I is tab, CTRL-D ends a communication. All of that goes back to teletype days. Also for telnet users out there you'll see that CTRL-[ lines up nicely with ESC. And when you see a ^@ being printed on the terminal you can see why it corresponds to a null byte.
One other interesting thing about ASCII: uppercasing and downcasing can be done by twiddling a single bit.
If you look at this picture of an ASR-33 Teletype you'll see that come of the control characters on the keyboard correspond to those in the ASCII set. This is because ASCII evolved from the earlier teletype character sets: http://upload.wikimedia.org/wikipedia/commons/0/0b/ASR-33_2.jpg
When I saw the title I was expecting to see a picture of the rogue screen. Rogue (and later hack, and nethack) is a text displayed dungeon exploration game and was often the first exposure folks got to the convention of h,j,k,l as left right up down.
I really miss having control over there. I xkeymap it there of course but some keyboards have a physically 'push-on/push-off' caps lock key there which is annoying.
IT IS THE NATURAL ORDER OF THINGS.
I'm still looking for a hardware dongle that does nothing but map the caps lock scan code to left ctrl. Sure, I can rebind the key (and I do) but as a contractor I move around a lot and having something that circumvents the OS entirely would come in handy.
> I'm not sure why FF was used for up.
Did you mean "used for right"?
All those awkward Control reaches originally laid comfortably under the thumbs.
The coolest part is that there is no microprocessor, just a bunch of 7400 series ICs and some DIP switches to configure things.
" remap h to i and use ijkl for inverse T cursor movement
map k g<Down>
map i g<Up>
map j <Left>
noremap h i
Then the 'i' key will be replaced by 'h'. So press 'h' to insert, or for inner selections, instead of 'i'. Also note the 'g' for up/down motions, which means it won't skip the wrapped part of lines - just remove the 'g' if you don't like that.If you're worried this breaks anything else, I've had this interfere with just one other thing: a plugin that let me select text based on indentation of the line the cursor was on, but I made a few minor changes to the vimfile for the plugin and fixed that pretty easily. The other thing is that random servers won't have these mapped, but just copy the config over if you'll be doing a lot of text editing on that server. Otherwise, you can just fall back to using hjkl awkwardly.
" disable arrow keys
nnoremap <Up> <nop>
nnoremap <Down> <nop>
nnoremap <Left> <nop>
nnoremap <Right> <nop>
Though I guess the mappings I provided would have to be noremap instead of map.
" remap <Leader> to ,
let mapleader = ","
" save with ,w
nmap <Leader>w :w<CR>
And then one day I walked into the lab with shiny new VT-100 terminals with their soft keys; but started hammering on them by habit. And everybody turned around and looked at me as if I was possessed..... :-D
http://vt100.net/volker-craig/vc4404-um.pdf