JKLÖ is the New HJKL

jklö keys

A few months ago I switched from Windows to Ubuntu. On Windows I used the mouse for many tasks but on Ubuntu this has changed dramatically.

i3

It all started with a friend telling me about the tiling window manager i3. It took a few days to get used to it and configuring the key bindings was a little annoying but now I’m more than happy with it. Especially the navigation using the jklö (german keyboard layout) or jkl; (american keyboard layout) keys is comfortable. You don’t have to leave the home row for switching or moving windows with the arrow keys. In one of my next posts I’ll introduce i3 in more detail.

i3 keybord bindings
Main navigation of the i3 window manager

Emacs vs Vim

The next step was finding an appropriate text editor. After some research my final two candidates were Emacs and Vim. The main reason for choosing Vim was the similar navigation to i3. The standard keybindings for navigating in Vim are hjkl and this article explains the historical reasons. Fortunately it is very easy to change the key bindings by modifying the .vimrc file. But this leads to the following question:

Why are people still using hjkl for navigation?

I guess there are only a few users out there typing on a ADM-3A terminal so this can’t be the reason. In combination with touch typing the hjkl navigation is obviously less useful than jklö (or jkl;). So why is it still out there? Probably because everybody’s got used to it? I really don’t get it.
The problem is that hjkl is pretty much everywhere. For example Evince, the standard PDF viewer on Ubuntu, has the hjkl navigation and I couldn’t find a way to change it to jklö. System admins would also run into trouble since there is no way to adjust the key bindings in every working environment they are using. Luckily this is no issue for me at the moment.

jklö. everywhere.

Once you are using the jklö navigation a lot in i3 and Vim you want to use it everywhere. Luckily there are many programs and plugins that support a Vim-like navigation. Examples are the Vimium extension for Chrome/Chromium, Vrapper for Eclipse, and the PDF viewer Zathura. Most of them can be configured easily by editing a config file. At the moment I’m focusing on my bachelor thesis but I’ll share my config files in a github repository when I’m happy with them.

Do you know any reasons for using the hjkl keys for navigation besides the historical one?

Image sources
Navigation of the i3 window manager: Michael Stapelberg

8 Responses to “JKLÖ is the New HJKL”

  1. hesselbom

    Actually, I quite felt the opposite.

    I’m starting to use i3 now and it feels very awkward to use jklö when I’m so used to hjkl from Vim. Why not use something people are used to?

    / A Vim user for a while back

    Reply
    • Martin Körner

      Well, I would say they use jklö since it’s more natural. The navigation is exactly where the four fingers of the right hand are. Luckily I’ve started “fresh” and wasn’t used to either hjkl or jklö.
      In your case it’s very easy to change the jklö navigation of i3 to hjkl.

      Reply
  2. Richard

    - hjkl works on every “qwert” keyboard, regardless of the national layout-version (hjkl; hjklö, hjklé…)
    – down is by far the most frequently used direction, and the pinky finger is much weaker then the others

    Reply
    • Martin Körner

      Your first point is a good one! I already had some trouble with different keyboard layouts.
      I think that the difference between pressing down with the index and middle finger is not that big but I get your pinky argument.
      It probably depends on which way you are used to.

      Reply
      • Richard

        To me there is a difference in sensation between J-K and K-L for down-up. (I keep my index finger on J, so with HJKL it operates H _and_ J, wile K is the middle finger, L is the ring finger). With JK the two fingers feel almost equally strong, but with KL the ring finger feels strange next to the middle finger.

        I was also a “homerow-nav virgin”, and tried i3-wm’s setup, but for compatibility I’ve changed i3’s shortcuts and learned HJKL instead.

        Next to HJKL and JKL; there is UHJK, IJKL (and WASD) with their ‘inverted T’ shapes (compatible with the arrow keys).
        If touch typing, Emacs’ FBNP works too, especially with A-E-D-V (home-end-delete-PgDn), but only if you can use your (right) thumb for the modifier key, as with Space2Ctrl or AltGr with AutoHotkey.

        With one hand I think IJKL is the best, but HJKL (maybe) beats it for *NIX compatibility reasons. UJKL is interesting too. As you can see I haven’t yet made up my mind… I might end up using my own invention.

        With two hands I am quite happy with the Emacs keys (with the above condition), because the load is more distributed between hands and fingers. PgUp can be G.

        For Firefox there is VimFx and Firemacs, and they can live together.

        Reply
        • Martin Körner

          Wow, seems like you did a lot of research on this topic!
          I’m used to K-L and for me it feels right but maybe it also depends on the hands. HJKL is everywhere so that’s definitely a plus.
          I hope you’ll find your perfect type of navigation soon :-)

          Reply
    • Étienne SERVAIS

      Sure it’s usual layouts on many keyboards but some guys (I’m one of them;) use special layouts. I’m using the BÉPO layout, a french version of the dvorak.

      In such a layout, the best way to keep using vim (which I totally love !) is to rebind everything. So I’m using BÉPO layout in insertion mode and american qwerty in edition mode (my bindings aren’t finished yet and I still have troubles:)

      Since my rest keys are the jkl; keys (tsrn in BÉPO) I changed it in my vim bindings. But the big trouble is then you can’t change bindings in evince — and I swear to god ! — it’s a pain to change layout (left hand) and then to change the rest position of the right hand ! Hope it will be possible to change this bindings in the future but right now I’m going to try i3 and zathura :D

      Reply
  3. Jose

    I agree, jkl; is much more handy, no doubt. The problem is, in Vi the default configuration is hjkl since the begining of the time, and if they now change to jkl; it would make some people really angry.
    In my case, im new to Vim. I used Emacs for a lot of years but I never tried Vim, At the begining, I was moving my right hand all the time to the left so I can reach the hjkl keys, but at the end I’m just used to move my finger when I have to press the h to go to the left. Of course, I tought about changing the configuration to use jkl;, but it’s not a good idea as you would have to change it on every editor you use (in your machine and in others). I think it’s better to get used to it.
    I started with i3 at the same time as with vim, and, in my opinion, i3 should change their layout to hjkl, as 99% of vim users use it. Even for me is very anoying and I’m just starting! I guess I will have to change the config to hjkl and use the G key for horizontal split.

    So, from newbie to newbie, don’t change vim config, change i3 instead!

    Cheers.

    Reply

Leave a Reply to Richard

Click here to cancel reply.