In Vim, why is ‘j’ used for down and ‘k’ for up?

The answer is in the Wikipedia entry for vi. Bill Joy, who wrote the visual mode of ex – which ended up being Vim’s precursor vi – used a Lear Siegler ADM-3A terminal on which the HJKL keys mapped to left, down, up, right – and it’s been that way ever since.

Here’s the keyboard layout:

keyboard layout of the ADM-3A

A couple of other points of note on the ADM-3A layout:

  • Left of the Q: the escape key – somewhat handier than where it is on keyboards today, hence a good choice for switching between normal and insert modes.
  • Top right: the ‘Home’ key doubles as the tilde (~), which subsequently became shorthand for a Unix user’s home directory.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)