3 ms·
I read that piece of advice when I started using Vim, and I'm very happy i did exactly that. If you're skittish about using Vim in the first place, then sure, i
by OskarS 7y ago
I read that piece of advice when I started using Vim, and I'm very happy i did exactly that. If you're skittish about using Vim in the first place, then sure, it's a pretty bad idea to tell someone to disable arrow keys, but for someone that's determined to learn how to use Vim, it's great advice.
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!
- YeGoblynQueenne 7y agoThanks - bu I don't get the "never leave the home row" point. My fingers constantly leave the home row- to press backspace, to press Alt-tab, to press Fn and a function key to turn volume or brightness up or down on my laptop, to scratch my nose, to grab my coffee cup etc etc. 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.
- OskarS 7y agoThe idea is that your fingers should leave the home row as little as possible while editing. I'm not saying that you should glue your hands to your desk, I'm saying that while in the flow of editing, your hands should remain in one place. 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.