htop
htop copied to clipboard
Add simple vim mode
This PR adds a "vim_mode" setting (false/0
by default) that causes keys to be remapped in the following way by the ScreenManager
:
+ h -> LEFT
+ j -> DOWN
+ k -> UP
+ l -> RIGHT
+ LEFT -> h (toggle help)
+ DOWN -> j (noop)
+ UP -> k (open kill menu)
+ RIGHT -> l (lsof current process)
+ K (Shift+K) -> k (open kill menu)
+ J (Shift+J) -> K (toggle show/hide kernel threads)
+ L (Shift+L) -> l (lsof current process)
I couldn't figure out where the manpage documentation is in the repo, though I admittedly did not look particularly hard.
I believe this change would be a welcome option for heavy vim users like myself who would like a familiar way to get around in htop.
I would like to have an option for vim bindings in normal htop though I prefer the shortcuts implemented by this fork: https://aur.archlinux.org/packages/htop-vim-git
Source code is here https://github.com/KoffeinFlummi/htop-vim
I'll have to check that out! My implementation has issues with the may I remap the keys so that typing k
when searching puts the character K
into the input string, so this implementation is not particularly good at all. :laughing:
See https://github.com/hishamhm/htop/issues/98
Would be nice to have a well maintained and packaged fork with vim bindings.
I like this patch overall, though I would leave the keys to what they do at the moment and do something like:
? -> h
q -> k
L -> l
instead, remapping the arrow keys like that wouldn't be very intuitive in my opinion.
Btw there are other system monitors with vim bindings. I'm currently using bottom
because it's configurable. There is also ytop
and more. Depends on what you need.
https://github.com/ClementTsang/bottom https://github.com/cjbassi/ytop
Btw there are other system monitors with vim bindings. I'm currently using
bottom
because it's configurable. There is alsoytop
and more. Depends on what you need.https://github.com/ClementTsang/bottom https://github.com/cjbassi/ytop
Thanks for the suggestions. Can finally switch to a modern one with more natural key-bindings. Bottom
looks great.
Merged here: htop-dev/htop@5c5a599