Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind n and p to next and previous line respectively #108

Open
jumper047 opened this issue Nov 30, 2022 · 7 comments
Open

Bind n and p to next and previous line respectively #108

jumper047 opened this issue Nov 30, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@jumper047
Copy link

I think it'll better fit for non-editable mode. Also this is how these bindings works almost everywhere across Emacs in similar modes

@abrochard
Copy link
Owner

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

@jumper047
Copy link
Author

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

@fbergroth
Copy link
Contributor

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.

@abrochard abrochard added enhancement New feature or request good first issue Good for newcomers labels Dec 5, 2022
@abrochard abrochard removed the good first issue Good for newcomers label Dec 13, 2022
@abrochard
Copy link
Owner

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 namespace
  • p is for port-forwarding
  • and S is for scaling replicas

It'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.

@jumper047
Copy link
Author

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)?

@abrochard
Copy link
Owner

Oh that's a pretty good suggestion. Leave this issue open please, I'm going to think about it!

@Kyrremann
Copy link
Contributor

Kyrremann commented Oct 5, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants