I'm just getting into using Vim. The way I learned to type I keep my fingers anchored over the "j,k,l,;" keys instead of the "h,j,k,l" keys. I'd like to change the key board short cuts to essentially move over the left,down,up,right functionality from the "h,j,k,l" keys to the "j,k,l,;" keys. Can anyone help me out?
Asked
Active
Viewed 877 times
1
-
2duplicate of http://stackoverflow.com/questions/3083928/vim-remapping-the-hjkl, although one might note that while that works, it leaves h mapped and I'm not sure you can unmap it without unmapping j as well. – numbers1311407 Nov 18 '12 at 17:57
-
1That being said, you probably don't want to do this. In vim, `h-j-k-l` is so fundamentally synonomous with `left-down-up-right` that by doing so you'll cause yourself trouble in the long run. You'll be remapping keys in every plugin you ever install that has directional keymaps. Even in basic vim, off the top of my head, you're already probably going to want to remap `
j` and the like. – numbers1311407 Nov 18 '12 at 18:06
1 Answers
3
The recent book Practical Vim by Drew Neil has an interesting discussion on this topic:
You’re wasting keystrokes if you press the h key more than two times in a row. When it comes to moving horizontally, you can get around quicker using word-wise or character search motions.
...
I’m pleased that the ; key rests comfortably beneath my little finger.
[Given that ; is the "find next" key for the f search command.]

Matthew Strawbridge
- 19,940
- 10
- 72
- 93
-
3Not exactly an answer... but I do agree. People new to vim tend to focus navigating with hjkl, but after using it a while, most people will navigate much more with searches: `/?ft` and motion commands. – numbers1311407 Nov 18 '12 at 18:03
-
I tend to see `hjkl` as the tree that hides the forest. `hl` suck just as much as `
– romainl Nov 18 '12 at 20:57` when you know `wbe` and counts. That newbie focus on `hjkl` is surprising, really, if you consider that those movements are in vimtutor. -
Thanks for the responses. I'm still a little confused about what to take away from this. Is the point of that quote that VIM is already optimized for people who type with their fingers anchored over the (j,k,l,;) keys? – Ben Pearce Nov 19 '12 at 07:15
-
I think the (perhaps surprising) take-away is that you're likely to press `;` at least as often as `h` if you're grokking Vim, so having to stretch for `h` doesn't matter. – Matthew Strawbridge Nov 19 '12 at 11:25
-
Forgive me if this is too off topic, but I'm not able to get ";" to do anything. Does it work on Vim for Macs? If so in what context does it do something? – Ben Pearce Nov 19 '12 at 22:07
-
@BenPearce Not sure about Vim for Macs, but the idea is that pressing `f` followed by a character key will jump to the right on the current line to the next occurrence of that character. After this, `;` will jump to the next match. If you get used to finding *rare* characters (e.g. capital letters), it's a very effective way to move around quickly. – Matthew Strawbridge Nov 20 '12 at 09:56
-
Cool! Not sure about the rare characters part but I do have the basic "f" functionality working. – Ben Pearce Nov 20 '12 at 20:31