by YeGoblynQueenne · 7y ago · 0 comments
This has gotta be the worse piece of advice I've ever heard in my life, second only to "why don't you march towards my line?" [1]. I've been using Vim for umm, eight years? Thereabouts. I never turn off my arrow keys. How much time are you supposed to save like that? Milliseconds? You go much faster with B, E, Crl+Y, Crl+D anyway.
Just misguided advice from otherwise well-meaning folks, that's all.
Edit: btw, how do you go through your recent command history on vim without up and down arrow? Do you have to q: and navigate with hjkl every single time? Is that more productive than pressing up arrow three or four times?
_____________
[1] Sorry guys, Warhammer Fantasy Battles reference there. See, I got a shooty Dwarf army, he's got a shooty Empire army, so we're standing just outside each other's range and scream insults at each other. His light cav mauls itself on my Slayers trying to flank my Thunderers (yeah, I don't know what he was thinking, either). He's got a Steam Tank, but I got a Lord on a shield (with a metric shitton of runes) protected by a regiment of Ironbreakers (with a metric shitton of runes) on the Tank's side. So noone's going anywhere in a hurry. So, by way of friendly advice, he says "why don't you march towards my line?". Yeah, right. So your Sniper can pick out my Lord and your Tank and Knights can sanswich my guys? You kiddin'?
Btw, he did win anyway. It turns out you gotta make _a lot_ of saves against a well-designed Steam Tank. Also, I suck at aiming artillery. But, come on. "Walk towards my line"? Do I look like an Elf or something?
The point isn't to save time (though using hjkl does that for sure), it's to make sure your hands never leave the home row, which they ideally shouldn't do very often when using vim. It makes them more natural to use for composition: "c3h" is much cleaner than "c3<left arrow key>".
Also: if you become an "intermediate/advanced" user, you use these keys much more rarely anyway: I use "w" and "b" far more often than "h" and "l" to move inside of a line, as an example. Breaking your dependency on arrow keys makes this transition easier.
Besides, it frees up four arrow keys on your keyboard up to do all sorts of fun stuff with! I have mine bound to switching windows (so "left arrow key" is moves focus one window to the left), and with modifiers they create window splits. Makes using windows in Vim a breeze!
Anyway if you've bound your arrow keys to switching windows (and if you're anything like me you have a two or three windows per tab, and a bazillion of tabs, open at any one time) then your fingers do leave the home row to go to the arrow keys anyway. So what's the point?
So, sorry but I don't agree that most users would save any significant time with disabling their arrow keys. Perhaps some users would - but that should be left to each individual user. Me, I'm used to navigating around lines with the arrow keys, I abhor hkjl navigation (I even use the arrow keys on my numpad in Nethack) and I'm perfectly comfortable using vim as my only text editor since 2011 or thereabouts, when I first picked it up.
Regular typing provides an instructive example here. Try typing a long sentence right now. If you're a touch typist, you can notice that your fingers very rarely leave the home row. Even if you're pressing shift or enter, you can basically just stretch your hand a little bit, but you can reach all the letter keys and the spacebar without moving your hands. You get into a flow where your hands remain basically fixed and the typing just flows out of you very comfortably (I'm doing it right now).
However, if you decide you need to use the arrow keys, you need to move your right hand quite a distance, and it interrupts the "typing" flow. Keyboards are designed to make this comfortable, that's why there's those little nubbins on F and J so that you always know where your home row is and where your hands are inside of it.
One of the ideas with Vim's editing commands is that editing text should become as natural as typing text is, since that's what you're doing most of the time as a coder. Imagine typing regularly and having to move your entire right hand every fifth keystroke. It would be pretty terrible.
I can personally attest that it works, and that I've very glad I rid myself of those arrow keys for regular editing. Moving to a different window doesn't happen in the middle of the "flow" (just like Alt-Tab, or changing volume or whatever doesn't), so it's fine to use them for that.
I can tell you're pretty set in your ways of how to use Vim, and that's fine: if you want to use the arrow keys, go ahead! There's no law against it, use Vim however you like. But what you're saying is essentially "all those people who say it's helpful not to use the arrow keys are lying or delusional!" I'm here to tell you that we're not. It really does work really well for us.
cnoremap <C-P> <Up>
cnoremap <C-N> <Down>
are two of the best lines I ever added to my vimrc.