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

Alter default key-bindings #625

Open
Nicholas-Autio-Mitchell opened this issue Mar 15, 2020 · 9 comments
Open

Alter default key-bindings #625

Nicholas-Autio-Mitchell opened this issue Mar 15, 2020 · 9 comments
Labels
enhancement New feature or request noodle

Comments

@Nicholas-Autio-Mitchell




Thanks for this wonderfully useful tool!

Is your feature request related to a problem? Please describe.
Some of the essential key-bindings (such as Contol-d to delete a job/pod) conflict with those used in my terminal/TMUX environment, meaning I have to always perform those in another terminal using e.g. kubectl delete pods ....

Describe the solution you'd like
A way to change the default key-bindings. Looking in the documentation and skimming the source code, I haven't seen a place to do this myself. I am not talking about the hotkeys option; as far as I can tell, they are a separate feature that also shouldn't contain any of the basic key-bindings.

Describe alternatives you've considered
Another YAML file where all keybindings are stored and can be overridden. I am not sure how they are currently implemented, and am not fussy about how a solution may work.

Additional context

@derailed derailed added the enhancement New feature or request label Mar 15, 2020
@victorboissiere
Copy link

victorboissiere commented May 13, 2020

I have the same issue and I have to browse the code to override the default command: https://github.com/derailed/k9s/search?q=NewKeyAction&unscoped_q=NewKeyAction

what could be great is to generated a default hotkeys.yml so we can easily override and add custom commands

@arash-bizcover
Copy link

yes and everytime by default I press q

I'm dying to put q instead of Esc

@dagadbm
Copy link

dagadbm commented Aug 19, 2020

i cant even use the tool because i use tmux ctrl-a as leader..

@milj
Copy link

milj commented Sep 8, 2022

It would be great, for example to be able to use the insert key instead of space key to select items (as in mc).

@TLINDEN
Copy link

TLINDEN commented Apr 11, 2023

It is possible to define custom key bindings in hotkey.yml. Eg:

hotKey:
  q:
    shortCut:    q
    description: exit
    command:     quit

  Delete:
    shortCut:    Delete
    description: Delete resource
    command:     delete

The first one works like a charm, but I get an error Ruroh? 'delete' command not found with the other.

It's also not possible to overwrite existing key bindings that way.

@dudicoco
Copy link

@derailed are there any plans on implementing this?

@darthbanana13
Copy link

darthbanana13 commented Apr 4, 2024

I found a partial workaround for people that have conflicting bindings with other applicaitons like tmux or that simply would like to use CTRL+Z to minimize K9s. Just edit a defintion with your editor, and then the k9s hotkeys are inactive. When you're done simply exit the editor without saving. It's not the best workaround, I admit.

@matthewgrossman
Copy link

Has anyone been successful in binding a different key to back? I have <esc> already mapped in my terminal, so I'd rather have something like q be back.

I have a hotkeys.yml like:

hotKey:
  q:
    shortCut: q
    description: Go back
    command: Back

but I get a "Ruroh?" as well for this, presumably because Back is not a valid command.

@mikerobe
Copy link

Yeah I have the same challenge with many of the default keybindings in k9s. It would be great if the keyboard commands could be more extensively customized, ideally including chords.

One great example is yazi, which has keybindings that can be customized using a toml file that can execute commands either in their API or using lua plugins. It's a very powerful system (somewhat reminiscent of neovim) that would be great to see here. I believe yazi is open source but written in Rust.

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

No branches or pull requests