Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

Currently unix text editor vi has the following keys for navigation.

h   move left   
j   move down    
k   move up     
l   move right

On keyboard they aligned: Left, Down, Up, Right

But while typing normally we move from top-left to bottom-right, so Left, Up, Down, Rightis more intuitive.

So why its developer selected that order?

Indeed I used AutoHotKey app to simulate this shortcuts in windows-wide. And I vacillate between following vim style or using mine!?

share|improve this question
3  
If you have your index finger on j and middle finger on k, it feels more natural to have the shorter (therefore slightly lower) and also more dominant index finger scrolling down and the higher middle finger to move up. ? –  Roger Attrill Nov 26 '12 at 10:02
1  
By the way, Dance Dance Revolution uses Vi-direction arrows –  Izkata Nov 26 '12 at 13:25
    
@RogerAttrill Thanks, Really it make that a little more natural :) –  PHPst Nov 26 '12 at 13:39
    
The vi cursor key order also influenced that of later home computer keyboards. The Sinclair ZX80, ZX81 and ZX Spectrum in the 1980s all mapped left, down, up and right to the 5, 6, 7 and 8 keys, for example. –  scottishwildcat Nov 26 '12 at 14:23
1  
I have the same confusion with the up and down keys. My mnemonic: "Fuck up" - since "up" is your middle finger. –  Mike M. Lin Nov 27 '12 at 20:38

4 Answers 4

The way I see it, the advantage is speed through efficiency of motion. People who use Vi or Vim these days tend to be expert users. Design for expert users is totally different than your average consumer. Expert users will generally take the time to learn and remember complex shortcuts if they have enough of a speed payoff.

I personally use Vim for all my development, because it's that much faster. Moving your hand back and forth between the mouse and keyboard takes a lot more time than you think it does. The same applies to moving your hand to different parts of the keyboard. By putting the "arrow" keys right under your fingers, users don't need to move to access them.

It's almost always faster to keep information in the mind than on the screen. The same works for the keyboard: it's faster to just remember that j is down than to move your hand to a separate part of the keyboard that provides a visual key mapping.

Vim is terribly complex, but it's specifically designed to minimize keystrokes. The layout of the specific keys is an arbitrary mapping carried along from the early days, but learning that mapping is something you just do once and move on. It's not intuitive at all, but that's not the point of this design. The goal is speed.

share|improve this answer

Even ignoring the historical background, I prefer j to be the down arrow because it's under my index finger and the key has a mark that can be easily felt. As it is the direction key I use most, I consider it a good fit.

share|improve this answer
    
Personally the key I would use the most is Left, so it would make more sense for me for this to be the function for J. But all that proves is that everyone has their own subjective preference, so unless VI tested with a huge user sample and came to this reasoning (unlikely) then the other possibility as to why this was chosen is neatly summarised by @Mariusz. –  JonW Nov 26 '12 at 15:12
    
In think up and down keys in average are used equally. You have to go up before going down in a text editor –  PHPst Nov 27 '12 at 16:22
2  
If you editing, yes, but when you read text down is the way to go. Especially if you use Vim for non-programming text, or simply read logs, the J key is usually more used than K. –  BoppreH Nov 27 '12 at 18:04

More intuitive keys would be j(<), i(^), k(>), m(v) (assuming your keyboard has the same layout as mine - Ergonomic qwerty), however, as Mariusz pointed out, the consideration behind vi's key assignments was no based on consideration which keys would be the intuitive.

share|improve this answer
2  
Any literature to back this up? –  VoronoiPotato Nov 26 '12 at 13:24
2  
@ Your order is even more intuitive, but I thing its creator wanted to use home row keys for this task. –  PHPst Nov 26 '12 at 13:24
    
@VoronoiPotato literature to back up that the up should be on top and the down below!? Do you need literature to back up the arrow keys placement on your keyboard? –  Danny Varod Nov 26 '12 at 13:59
    
@Reza there are not many things in old *nix systems that are user-experience oriented. That was not a major consideration. –  Danny Varod Nov 26 '12 at 14:00
1  
I'm just saying why that particular configuration. If we were not restricting ourselves to homerow why not the more ubiquitous WASD. –  VoronoiPotato Nov 26 '12 at 14:45

The answer is more trivial than you probably think - it's because h, j, k, l were respectively left, down, up, right arrows on the ADM-3A terminal which Bill Joy used when creating the original Vi [1].

[1] http://www.catonmat.net/blog/why-vim-uses-hjkl-as-arrow-keys/

share|improve this answer
7  
@Thanks, So now question is about "unintuitive ADM3A keyboard layout" ! ;) –  PHPst Nov 26 '12 at 13:46
3  
Related fact: Ctrl+H sends the ASCII code for backspace, so having left arrow on H kinda makes sense. Likewise, Ctrl+J sends newline, so down arrow makes sense. Ctrl+K sends vertical tab and Ctrl+L sends form feed, which don't map quite so nicely to 'up' and 'right', but are still in the ballpark. –  scottishwildcat Nov 26 '12 at 14:36
    
On the ADM-3A, those meta-behaviors required the Ctrl key, so Ctrl+H and Ctrl+J were left and down (and pre-dated that terminal). It's only the behaviors of +K and +L that were "created" –  Plutor Nov 26 '12 at 16:57
1  
That's basically it. vi copied ADM-3A. ADM-3A had that format because of the way control used to work. What the control key used to do was drop bits 6 & 7 of the ASCII character. That caused HJKL to map to ASCII control codes 08 (backspace/left), 12 (linefeed/down), 13 (vertical tab/up) & 14 (form feed/right). Since those four keys were on the home row you could sit there holding control and move around very quickly. –  adrianh Nov 26 '12 at 17:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.