Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Vim, why are the navigation keys HJKL and not JKL;? [closed]

Tags:

vim

How does this not bother anyone? I used to rebind it but recently I've been trying the standard layout just to see what I'm missing. Isn't it easier to not move your finger to H and then back again to J?

And I know VIM has some ancestor(s) that had the same four keys, but that's not really the reason. VIM didn't have to use those keys.

like image 291
Here2Help Avatar asked Oct 15 '25 19:10

Here2Help


1 Answers

30 years ago, Vim's author created it because he couldn't run vi on his amiga for licensing reasons. The whole point of the existence of Vim was to provide a convincing vi clone so it uses hjkl, just like the original. Vim evolved quite a lot over time but that primary goal didn't go away. If you don't like hjkl map them to something that makes more sense to you.

It may come as a shock to you, but Vi's (and thus Vim's) use of hjkl for cursor movement has literally nothing to do with touch-typing at all.

For reference:

  • Vim uses hjkl because vi did.
  • Vi used hjkl because its creator's keyboard didn't have physical cursor keys. Instead, the arrows were printed on the hjkl keys.
  • The arrow keys were printed on hjkl because the corresponding control codes all moved the cursor in directions roughly similar to the cursor keys: ^H for "backspace, ^J for "line feed", ^K for "upline", and ^L for "forward space".
like image 182
romainl Avatar answered Oct 17 '25 08:10

romainl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!