Open jumper047 opened 1 year ago
Hi @jumper047 , Thank you for sharing this. Do you have examples of other modes that do that? I just to make sure we get the UX right
Thank you for not rejecting this issue:) - app defaults can be very sensitive question. Regarding examples: just some of them which comes to my mind and I'm using often: dired, ibuffer, magit, mentor (torrent client), treemacs, dap-mode
kubel-mode
is deriving from tabulated-list-mode
and is overriding the standard n
and p
bindings from the tabulated-list-mode-map
, and also S
(tabulated-list-sort
), which is kinda useful.
I reviewed the code and I now remember why n
and p
aren't used for next and previous line respectively:
n
is for setting the namespacep
is for port-forwardingS
is for scaling replicasIt's not crazy to imagine a new set of keybindings for these methods and restore n
and p
to their "sensible" defaults values but it would be a breaking change and very confusing at first.
Personally I rebound namespaces and ports to N
and P
respectively in my config, and pretty happy with it:). Still think it's better choice than default one, but also this change will be really confusing for existing customers.. So I suppose it's better to leave it as is. Can I close this issue, or it will be good place for further discussion (if any)?
Oh that's a pretty good suggestion. Leave this issue open please, I'm going to think about it!
This has also been irritating me, so I solved it by extending the key map.
(use-package kubel
:bind (
(:map kubel-mode-map
("N" . kubel-set-namespace)
("P" . kubel-port-forward-pod)
("n" . #'next-line)
("p" . #'previous-line))))
By adding ("S" . #'tabulated-list-sort)
you can easily sort the list and reverse it (this is by column Meta + left/right), but then you need to find a different key binding for scaling. I ended up using ("M-s" . kubel-scale-replicas)
.
I think it'll better fit for non-editable mode. Also this is how these bindings works almost everywhere across Emacs in similar modes