In vim, why is 'j' used for down and 'k' for up?

后端 未结 6 746
一生所求
一生所求 2021-02-02 05:21

I\'ve been using vim for many years and have never really thought about it. A friend of mine asked why that is, noting that in our culture, left would usually map to up while ri

6条回答
  •  面向向阳花
    2021-02-02 05:40

    The answer is in the wikipedia entry for vi. Bill joy, who wrote the visual mode of ex - which ended up being vim precursor vi - used a Lear Siegler ADM3A terminal on which the H, J, K, L keys mapped to left, down, up, right - and its been that way ever since.

    Here's the keyboard layout:

    enter image description here

    A couple of other points of note on the ADM3A 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.

提交回复
热议问题