3 ms·
The other movement commands you mention aren't "better" than the hjkl keys. They are very useful, but accomplish different things. For example, the h key move
by gnosis 13y ago
The other movement commands you mention aren't "better" than the hjkl keys. They are very useful, but accomplish different things.
For example, the h key moves one character left. Those other movement keys aren't going to do that for you except in special circumstances.
That said, no one is suggesting that in vim the only movement keys one should use are hjkl. Those other movement keys you mention are also very important, and you definitely should learn them after mastering hjkl.
As for the arrow keys, the sooner you break free of that crutch, the better. You will find your editing efficiency improves immensely when you are able to keep your fingers mostly on the home row.
It's like the difference between touch typing vs hunt and peck typing. Some people are actually quite fast hunt and peck typers. But a touch typist will feel nothing but pity for all the energy they waste hunting and pecking when they could be comfortably and leisurely typing by touch.
There are some limited uses cases for the arrow keys in vim, however; such as occasional one-handed browsing with the arrow keys and page-up/page-down keys, which are conveniently close together on many US keyboards. (Don't mistake this use case for movement while editing, which is very different from simply browsing through a document.)
I've also known of people who use their arrow keys for accomplishing tasks such as resizing windows, which is a reasonable use case because it's generally done infrequently enough for the extra hand motion not to matter.
- johncoltrane 13y agoFuck, I just lost 20 fucking minutes of typing. What's with that stupid "link expired" bullshit? Whatever, I had a nice demonstration where the same simple task used 39 keypresses with only k + h, 9 keypresses with k + b and only 5-6 keypresses with a backward search. After that, the last paragraph went something like this: "hjkl have their place in our arsenal, obviously, but focusing on them like if they were the apex of productivity and the single key to mastering Vim is both misleading and absurd." --- Also, the only reason why Vim uses hjkl for movement is because the terminal on which Bill Joy created Vi didn't have physical arrows. The whole homerow/efficiency business is just post facto rationalizing.
- rickhanlonii 13y agoNext time, at least in Chrome, you can hit the back button to return to the page you were at with your text in tact. But, you probably wasted your time anyway because no one is disputing with you that you that there are quicker ways to navigate in Vim than exclusive use of hjkl. The argument is that there is a place for them in navigation, and that using them over the arrow keys keeps your hands on the home row allowing a smoother transition between navigation and input. Now, you may disagree that there's any loss by using the arrow keys in your workflow. And you may be right. But that certainly does not make the claim "hjkl are useless" universally accurate--which is what started this thread down this argument.
- johncoltrane 13y agoThe back button didn't keep my text. My original comment was only about hjkl vs motions: I didn't bring arrows in the discussion, the parent did. Also my claim was: > hjkl are almost worthless compared to other means of navigation and I stand by it. I didn't write "hjkl are useless" or advocate the use of arrows vs hjkl, IIRC. hjkl are better than the arrows for short range movements but those short range movements (1-3 cols, 1-3 lines) make up such a small part of the movements we actually do all day long that focusing on hjkl is just absurd. All the hjkl advocacy can be reduced to "Do whatever you'd do with arrows but with hjkl because it helps you save all those right hand movements… and home row." But char-by-car and line-by-line movement is just as slow and bad with hjkl as it is with arrows. Saving a few slight translations of the right hand is so worthless compared to the thousands of hjkl or arrows you save with bBwWeEfFtT/?{}() and friends… unless we try to save our wrists but why make productivity claims, then?
- rickhanlonii 13y agoI apologize, I did confuse you with the other commentator. Everyone agrees that using w to move a word at a time is better than llllllll. No one is arguing with you about that. So in that sense, we all agree that for certain movements, hjkl really is worthless compared to alternatives. But if you want to move a few characters, there's no better option than hljk. Second best are the arrow keys. But there's really no reason to move your hand out of position just to move one character when your finger is already on the key which will do it. So, I don't think it's at all accurate to say in general that hjkl is worthless compared to other means of navigation. They have their place, and they're quite valuable there since all other means of navigation are almost worthless compared to hjkl when moving a few characters.
- klibertp 13y ago"It's like the difference between touch typing vs hunt and peck typing. Some people are actually quite fast hunt and peck typers. But a touch typist will feel nothing but pity for all the energy they waste hunting and pecking when they could be comfortably and leisurely typing by touch." You realize that you just offended me? I "hunt and peck" 80 wpm and am quite comfortable with it, thank you. It's enough for me. Also I'd like to see some proof for oh that faster hjkl versus arrows, especially on non-standard keyboard where the distance is much closer.