Longtime vim users, do you keep your fingers on jkl; or hjkl in normal mode? Standard touch typing teaches us the home position for the right hand has the index finger on the j key, so your fingers are on jkl; . But standard vim motion keys are hjkl .
The left hand pinky finger starts things off on the “A” key, the ring finger sits on the “S” key, the middle finger takes the “D” and the index the “F.” Thumbs don't have a row and typically hover over the spacebar which can be hit with either hand, depending on the typist's preference.
I think that jkl;
is actually the more appropriate usage for vi. For one, h
and l
really don't matter that much. w
, e
, and b
are significantly more useful for horizontal navigation. As a bonus, ;
is easy to get at if the language requires it. Having a weaker finger on k
hurts, and you don't need your strongest finger on the h
, when it should be on the j
which is probably the most used of the four.
Neither of the previous 2 solutions was 100% satisfactory. I propose a 3rd way, one that combines the best of both worlds
Keep up/down where they are, then make 3rd & 4th fingers left & right
Then, to avoid overwriting base Vim features: Toss whatever used to be on ; to the now-empty h button
As a cute bonus, the "l" key now stands for "left" ;)
noremap l h
noremap ; l
noremap h ;
@alternative's recommendation. Keybinds stay default (hjkl), right hand stays on home row (jkl;)
Slide those 4 binds over 1 so they sit on the home row:
noremap ; l
noremap l k
noremap k j
noremap j h
I keep my hands on the home row, in the normal touch-typist manner. Rarely do I use the h key for movement, as moving one space to the left is not usually an efficient way to move (and does not really fit the essence of Vim).
I understand, that hjkl
is used for historic reasons (i.e. Here is why vim uses the hjkl keys as arrow keys) and it is not based on any ergonomic rationale.
I personally prefer to follow the approach recommended by i3 window manager which as explained in the FAQ on Why does the default config use jkl; instead of hjkl? is an ergonomic choice.
i3 uses
jkl;
because these keys make up the "home row" underneath your right hand when touch typing.
Check this on vim remapping the hjkl to jkl;
While I understand Vim's philosophy of having all the movement available in the home row, I found hjkl
to be counter intuitive. A much more saner map I thought would be a wasd-like setup with ijkl
nnoremap j h
nnoremap k j
nnoremap i k
I found this to be very easy to navigate with very natrually.
j:left
i:up
k:down
l:right
For toggling in/out of insert/normal mode, I personally use Alt-e
since I almost always use Gvim and not have to worry that some terminals have issues with Alt.
nnoremap <A-e> i
inoremap <A-e> <esc>l
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With