syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

Customizable hjkl for navigation #15192

Closed DrWaleedAYousef closed 2 years ago

DrWaleedAYousef commented 2 years ago

This is a feature request. I think it will be extremely valuable if the hjkl is customizale so that I can define it, e.g., jkil or any other sequence, with naturally reflects to other layers, modes, etc.

dalanicolai commented 2 years ago

The request is not clear. Redefining these keys is already possible and easy to achieve {see e.g. https://github.com/noctuid/evil-guide#global-keybindings-and-evil-states). If that is not what you mean then

DrWaleedAYousef commented 2 years ago

Thanks so much. The answer to your three questions is:

What do you think?

lebensterben commented 2 years ago

hjkl are keys on the home rows. using them as navigation keys reduces risk of hand injuries.

get used to them.

DrWaleedAYousef commented 2 years ago

hjkl are keys on the home rows. using them as navigation keys reduces risk of hand injuries.

get used to them.

But jkl; is much better because they are on the home row and you do not move any finger to reach any of them (as opposed to hjkl, where you have to move your finger to reach h)

lebensterben commented 2 years ago

read https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys

DrWaleedAYousef commented 2 years ago

Thanks. I know this history, but I am talking about the present. Why should we restrict ourselves to the hjkl while jkl; can be more convenient with less finger movement than hjkl

dalanicolai commented 2 years ago

@DrWaleedAYousef Thanks for your explanation. However, there is too little demand for this feature so that adding this configuration option is not worth the effort. Also, I agree with @lebensterben that you should probably get used to 'hjkl'. Of course, the main reason (I assume) for this default configuration is that the most important key, i.e. j/next-line, is placed under your 'primary' typing finger when your hand is in the 'touch type' home position. I guess (fortunately) we are stuck with this default.

Also, for users who really prefer a different configuration, it is already really easy to define personal keybindings.

lebensterben commented 2 years ago
DrWaleedAYousef commented 2 years ago
  • hjkl was used in original vi/vim because they were the arrow keys in some old keyboards.
  • due to the popularity of vi/vim, hjkl or at least jk is widely used in many free softwares.
  • evil-mode adopts vim-style key bindings including hjkl
  • spacemacs builds around evil-mode and other evil-* packages and that's one of our selling point.

I agree with all of what you said. However, there is no contradition with what I am suggesting. Offering jkl; as an option in addition to the default hijk is an advantage of course. Unless it is really a @dalanicolai said,

there is too little demand for this feature so that adding this configuration option is not worth the effort.s