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

Ability to overwrite / uninstall keybindings #460

Open
mt-inside opened this issue Feb 23, 2024 · 4 comments
Open

Ability to overwrite / uninstall keybindings #460

mt-inside opened this issue Feb 23, 2024 · 4 comments

Comments

@mt-inside
Copy link

Similar to #419 - currently adding a keybinding with the same keys as a built-in one doesn't replace it, it seems to add it to a list.
I can see why this behaviour is useful, but I also think the ability to override built-ins in a must. I also plain want to remove some built-in ones, like cmd+W on the mac - just closes the window without confirmation, bang, work gone! It's so easy to hit it when you're going for Ctrl+W (readline delete word). I've lost so much work I've nearly stopped using Rio.

Maybe the solution is a config command that clears the current action(s) for a key
{ key = "w", with = "super", action = "Clear" }

I then have maximum flexibility to:

  • Remove built-in binding, leaving key combo doing nothing
  • Remove built-in and add one or more of my own instead
  • Add my own on top of the built-in

I someone wanted to build the partial feature quickly, just changing the behaviour to overwrite (maybe a config option for this) would let me re-configure cmd+W to type "idiot" or something for now 😅

@raphamorim
Copy link
Owner

Hey @mt-inside thanks for the issue,

Actions None or ReceiveChar doesn't fit for your case? https://raphamorim.io/rio/docs/key-bindings#overwriting

@raphamorim
Copy link
Owner

Regarding the configuration, if you don't use tmux or similar you can use navigation as plain https://raphamorim.io/rio/docs/navigation#plain

@mt-inside
Copy link
Author

Hey @mt-inside thanks for the issue,

Actions None or ReceiveChar doesn't fit for your case? https://raphamorim.io/rio/docs/key-bindings#overwriting

Thanks for the reply!

Action="None" does indeed remove the keybinding. This is great, just what I needed, dunno how I missed that part of the docs.

However I think the docs are a little wrong. Because I hadn't seen Action=None, I was using text="Idiot" just to try to have something intercept Super+W and do something other than close the window. That does add to the existing binding - if I have Rio running tmux, and press Super+W, bang the window's gone, and when I reattach to that tmux, there's the text "Idiot". Is it possible that the overwrite behaviour is matching all three fields (key, with, and action) rather than just key and with ?

@mt-inside
Copy link
Author

Regarding the configuration, if you don't use tmux or similar you can use navigation as plain https://raphamorim.io/rio/docs/navigation#plain

Ah cool, I'd missed that too. Do "tabbing" keybindings include Super+Q and Super+W though? I'm fine now because I have the action=None solution, but probably worth clarifying in the docs.

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

No branches or pull requests

2 participants