vim, ijkl

January 24th, 2011 at 19:54

My coworkers finally managed to convince me to switch to vim. What a chore. I basically spent an entire weekend customizing someone else’s .vim directory to my tastes, which was mercifully easier than tracking down the plugins and configuring them myself, but it was a frustrating bit of changing my vimrc from within a vim that is not quite configured the way I want it.

It’s a real shame that the vim authors grew up in an era before video games. In my humble opinion ijkl (used in the same way as wasd) is a vastly superior directional scheme to hjkl. It’s directionally intuitive, unlike the linear hjkl, which relies on memorization. It also keeps your index finger on j, where it belongs on the home row. I use h for insert. It’s not as crazy as it sounds. How often do you repeat ‘go left’? Sometimes. How often do you repeat ‘insert’? Never. Because now you’re in insert mode. Stretching to h for repeated go-lefts became uncomfortable, and sometimes I would unconciously move my whole hand to start on h, which would offset my right handed typing and I’d have to find my place on the home row again after moving around.

So far I haven’t run into much trouble. At least vim has the configurability to change this sort of stuff, even if it does take me an entire weekend to get everything sorted out. Thanks go to Deewiant for this comment, which helped me get my bindings consitent.

Here’s the rebindings, for anyone who wants to join my little cult:

noremap i k
noremap I K
noremap <C-w>i <C-w>k
noremap <C-w>I <C-w>K
noremap <C-w><C-i> <C-w><C-k>


noremap j h
noremap J H
noremap <C-w>j <C-w>h
noremap <C-w>J <C-w>H
noremap <C-w><C-j> <C-w><C-h>

noremap k j
noremap K J
noremap <C-w>k <C-w>j
noremap <C-w>K <C-w>J
noremap <C-w><C-k> <C-w><C-k>

noremap h i