Arrow Keys Efficiency: vim HJKL vs IJKL

By Xah Lee. Date: . Last updated: .

vim use {h j k l} keys to move cursor. Another approach is Inverted T {i j k l}. This page investigates which is more efficient.

terminal ADM-3A keyboard
terminal ADM-3A keyboard, where Bill Joy used to create vi. Note the arrows on {h j k l}. [see History of Emacs and vi Keys]

Considering Key Frequency

Let's assign score to key positions with respect to ease of key press. Let's set k to have the max score of 1. We'd have something like this:

      h     j     k     l
     0.5   0.9    1    0.7

now look at these command's frequency.

Arrow Keys Frequency

[see Emacs's Command Frequency Statistics]

Multiply the percentage with the score. Let's use a Python script to calculate.

# -*- coding: utf-8 -*-
# python

# is vi's {h j k l} keys more efficient or inverted T {i j k l}

key_score = {

command_frequency = {

vi_key_map = {

inverted_T_map = {

vi_score =sum(map(lambda x: (key_score[x[0]] * command_frequency[x[1]]) , vi_key_map.iteritems()))

invertedT_score =sum(map(lambda x: (key_score[x[0]] * command_frequency[x[1]]) , inverted_T_map.iteritems()))

print("vi score", vi_score)                # 36.342
print("inverted T score", invertedT_score) # 36.248

so, this means, they are about the same degree of efficiency.

Try to adjust the key score or command frequency. Overall, score comes out about the same.

This test only considers ease of each key press. For just these 4 keys, this simple measure can be considered a reasonable test of efficiency. But note that a robust test should also consider bigram frequency and other factors. [see What's the Most Efficient Keyboard Layout?]

Considering Bigrams

google pacman
Google Pacman

vi has h moved away, while inverted T has the i moved away. Which one is better? I think if you consider this, then the inverted T is better. Because, consider all 2-key combinations involving the one key that's moved away. The vi way, involving a moved index finger left/right for , is more costy than the moved middle finger up/down. This with vi is pretty bad. This can be easily seen when playing pacman.

Considering Intuitiveness

Another factor is intuitiveness. The inverted T is more intuitive. vi's row arrows require learning. That's one big win for inverted T.


Inverted T is probably slightly better. The winning point is when considering bigram. vi's way is especially bad when you have frequent left/right movement.

Did i $save$ you from getting a brick?

$5 me, at patreon
or paypal to

If you have a question, put $5 at patreon and message me.