htop icon indicating copy to clipboard operation
htop copied to clipboard

Ability to remap keys or enable Vim-mode

Open vatosarmat opened this issue 3 years ago • 6 comments

Is it possible to have hjkl bindings without Alt? If yes, this should be described in README.md or in man page. If no, let it be the feature request

vatosarmat avatar May 24 '21 06:05 vatosarmat

Unfortunately hjkl conflicts with k for killing processes as well as H and K for toggling display of userland/kernel threads. While there were proposals for vim key bindings, these have not been further worked on, due to too many conflicts with proper remapping of the keys. Cf. #34, #37, #69, #106, #141 for some examples of various problems we had with this. For proper remapping support, the full keybinding API would have to get an overhaul, which is currently no priority as there's other areas in htop that need working on much more urgent.

BenBE avatar May 24 '21 10:05 BenBE

@vatosarmat You should take a look at this fork of htop which comes with vim-keybindings.

paniash avatar May 24 '21 13:05 paniash

Why 'support request'? People do create popular forks which means this feature is desired by many. Is not it worth to have a 'feature request' issue opened for the feature desired by many? Maybe someone even could contribute

vatosarmat avatar May 24 '21 15:05 vatosarmat

Why 'support request'?

Accidentally misread the initial comment, missing the second part.

This being said, the wording in a feature request should bear some more details on how things are expected to work. Currently there are two possible directions this could go: full remap ability for all keys vs. have all key bindings similar to keys used in VIM (like is done in the fork).

People do create popular forks which means this feature is desired by many.

Noted.

But as I hinted at by linking previous issues and PR regarding this topic (we had more than those mentioned), we are quite aware of this and work on this subject has been done in the past. Unfortunately that work had to be reverted - or didn't even land in the dev branch - due to compatibility issues or severe bugs introduced in those commits.

One further issue we noted while experimenting with VIM mode was the issue of key mappings that should be equal for both active and disabled VIM mode to allow for a consistent experience when switching those modes.

Is not it worth to have a 'feature request' issue opened for the feature desired by many? Maybe someone even could contribute.

Changed to feature request. The needs discussion is mostly an internal reminder for things that need internal discussion and clarification on how to go forward.

BenBE avatar May 24 '21 19:05 BenBE

Personally I would prefer to have fully-customizable keybindings. I am not a fan of Vim bindings and mostly like the defaults, but there are a few things I'd like to be able to add bindings for (like D as a shortcut to sort by Disk R/W).

defaultxr avatar Sep 03 '23 06:09 defaultxr