Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> For hjkl I just used arrow keys since they are nicer and I dont find much difference between them.

The point of hjkl is to keep your fingers in the home row of your keyboard. This is generally accepted to be good typing practice as it improves speed.



>> The point of hjkl is to keep your fingers in the home row of your keyboard. This is generally accepted to be good typing practice as it improves speed.

You might get some benefit to speed if you keep your hands on the home row, or you might not. This is mostly something people have been repeating as gospel, but I'm not aware of anyone testing it.

Intuitively, using the arrow keys to move the cursor without inserting a character should be faster. Assuming one is moving around the text while editing, it takes at least three keypresses to use hjkl to move the cursor without inserting a character: one to switch to command mode, one to move the cursor, and one to switch back to insert mode. That's because hjkl in insert mode simply insert their respective letters. By contrast, using the arrow keys to move the cursor without inserting a character needs one keypress: to press an arrow key.

Even if you count moving your hand to the arrow keys and back as two distinct "operations", and each keypress as a single operation, it takes at least three operations to use the arrow keys (i.e. as many as using hjkl): one to move a hand to the arrow keys, one to press a key, and one to move the hand back. Assuming that each operation takes constant time, that means that, at best, there is no advantage over keeping your hands at the home row and moving the cursor with hjkl, than using the arrow keys.

So that idea, that it's faster to keep one's hands in the home row, must be a superstition.

Incidentally, I've been using vim continuously since 2011. These days at work I use a Spanish QWERTY keyboard, but with an English Euro layout. I got the Spanish keyboard by mistake and it was simpler to keep using it with the layout I know, and benefit from more than a decade of muscle memory, than to try and learn the new key positions (and combinations). This is another reason why I am skeptical of the claim about the home row: muscle memory is faster than any spatial optimisation you may think of, or, rather, if you've already learned to move your hands one way and can do it fast, changing to a new way will slow you down, first. And then we're talking about long-term gains of maybe a few milliseconds in the long term in this case. That sounds pointless.


I tried to use the hjkl key bindings, I hated them, and since I remember, I also use the arrow keys.

The keys are positioned differently, and that helps me with muscle memory.

The fact they are not in a row is a feature.

Of course, I am also a touch typist and I wrote this entire comment without looking at the keyboard or making a single mistake.


> but I'm not aware of anyone testing it.

It definitely worked for me. YMMV

Don't toss it till you try it.


Not only that, it is more ergonomic -- if you can get the same thing done without moving your arm so much, it reduces the strain.

It is for this exact reason I am using vim in VSCode. I get some speed up in vim vs mastering VSCode shortcuts, but not enough that would make me switch. However, with vim I hardly need to move my arm over to use arrow keys or mouse, which makes it much easier on my hands and my arm.


I remap to jkl; to be even more home-row efficient (and less RSI-inducing). I wish I did that decades ago.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: