Let's be a better vim user

Published on 2012-11-04 15:16:47+00:00
editor   programming   unix   vim  

It's November. For many, that means a month of writing (NaNoWriMo). For others, that's a month of cultivating a fine moustache (Movember).

I, however, am making an effort to become a better vim user. Call it NoVIMber or VIMmember or whatever. I'll try to periodically blog about what I'm doing, but I'm not making any promises (other than to force myself to be more productive).

I've been using vim for a long time (since grad-school... 2001ish), but for far too long, I've just been using what I already know, rather than continuously learning. So here's how I'm starting out...

Quicker Navigation

I still use the mouse (well, magic trackpad) for a lot of things, so I've got a very bad habit of using the arrow keys to navigate through a file. This is the slow way of moving around, so for the last couple of days, I've been retraining myself to use vim's basic (better) navigation.

That's h, j, k, l (left, down, up, right) instead of arrow keys, and w (skip ahead by word), and b (move back a word).

All of these commands also take numeric arguments: 5j to move down 5 lines; 3w to move forward 3 words.

Effectively navigating withing a file using these commands makes for much quicker editing. So, from here on out, if you see my with my hands on the arrow keys, please call me out.