Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The left - right with the H J K L keys? Or the normal Keys ? And why is this a bad habit?


Moving around with hjkl is a bad habit to be discouraged. It's not the vi way.

Well, j and k are fine if you're not moving far. A lot of slow scrolling up and down should be { and } or C-d and C-u or <count>[jk]. Even better: Use / and ?. It's bad to be repeatedly tapping j and k or waiting for the keys to repeat.

But h and l are the EMACS approach. You should be moving in a line with w, e, b, f, F, t, T, ^, $, I, A, 0, and the like. Vi provides lots of tools for efficient line editing and h and l are not good.

Beginners should try

    :noremap h <nop>
    :noremap l <nop>
to keep them from the temptation of the nefarious h and l keys.

Lately I use

    :no h ^
    :no l $
which is even better because ^ and $ require moving your hands off the home row even though they're much better than h and l for you.


Huh. The "vim way" goal posts have moved even further. Used to be "no-op your arrow keys and use hjkl", now it's "noop your hjkl keys".

Something I, as a dedicated VIM user, will never do. 'hjkl' work fine, and are a good addition to 'we{}$0' and so forth. I can't personally find the value of hobbling myself for the sake of meeting someone else's definition of the ideal user.

I even occasionally use the arrow keys. Heresy, I know.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: