Colemak and vim: “But what about h/j/k/l?”

I have my phone set to alert me when anyone mentions Colemak on twitter. It’s a fun one to follow, you get new people trying out Colemak at least once a week, and i love to encourage people.

One thing i see a lot is programmers talking about vim, and asking what you do about the h/j/k/l keys. Do you remap them or relearn them?

There is at least one person who has made a colemak-vim remapping plugin (see this discussion in the Colemak forum), but i can’t imagine it working well. If you try to put h/j/k/l back where you’re used to them then you have to find new homes for n, e and i. (h actually stays in the same place) As you may well know, if you’re reading this, n is next search match, e is end of word, and i gets you to insert mode.

So if you move those keys, where would you put them? Almost every letter in vim has some sort of significance, and many of them are chosen for the action they stand for, which is part of the power of vim.

My answer is to relearn them. Maybe it’s easy for me because i was on Dvorak when i learned vim, so i was never attached to the position of h/j/k/l in the first place. Curiously enough, in Colemak h/j/k/l all end up on the same finger: the index finger of the right hand. Some people complain that j and k feel upside down, and they do at first, but then you realise that Apple is busy rewiring our brains with “natural scrolling” (which i think is just awesome, by the way) and before you know it, Colemak and vim feel perfectly wonderful together!

So my advice: print out one of these Colemak/vim cheat sheets and just get used to it!

vi / vim graphical cheat sheet - Colemak version

Look! i’ve even done a typematrix version for all you Colemak people who pair program and need a keyboard with a hard wired Colemak switch!

vi / vim graphical cheat sheet - Colemak TypeMatrix version

Of course, the other great thing to note about Colemak is one of its big advantages over Dvorak: that punctuation characters remain in their QWERTY positions. Which is very useful for vim users! :)

About these ads

3 comments on “Colemak and vim: “But what about h/j/k/l?”

  1. Hi aimee, I was not sure about remap or not. I was looking for an answer from an experienced programmer, about colemak-keyboards-with-vim. I found this answer, that is better get used to colemak-keyboards-with-emacs-or-vim than remap
    http://stackoverflow.com/questions/253820/colemak-keyboards-with-emacs-or-vim/1885406#1885406 The last paragraph >> “As well, there are Vim plugins you may get one day that will clash with your remappings, or you will read a Vim tip one day about a feature which you can’t now use because you have remapped things.

    It will be a real pain for you, so I wouldn’t bother with any remappings. ”

    Aimee, at this date, it is the best solution?
    thanks.

    • Hi gunt,

      I definitely think it is best to learn vim/emac without remapping. Sure, h/j/k/l are in weird places, but you do get used to it surprisingly easy. You do it so often, your fingers just start to get the hang of it and you do it without even thinking.

  2. This is my first comment in Colemak, and as a fellow Vim user I wanted to thank you for your perspective and the cheatsheet. The point about natural scrolling was especially relevant.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s