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

Override default key bindings, not add to them #1221

Open
nzeh opened this issue Nov 10, 2024 · 5 comments
Open

Override default key bindings, not add to them #1221

nzeh opened this issue Nov 10, 2024 · 5 comments

Comments

@nzeh
Copy link

nzeh commented Nov 10, 2024

I'm really liking sioyek. What I'm trying to do now is to add completely custom keybindings that override the default ones. It seems to me that the bindings in keys_user only add to the existing ones. Is there a way to replace existing ones?

I have a partial answer, but it's not good enough for what I'm trying to do: If I want to rebind key to a new command, all I have to do is add a line

to my config. Here is where it gets weird: In the default config 'v' stands for visual select. I am trying to make this a prefix to mean "View something". Like "View portal window", "View preview", ... I want to have bindings like 'vp', 'v', ... for them, in the same spirit as 'gg', ... If I just add bindings for 'vp', ..., then they never get executed because the moment I press 'v', it gets interpreted as "enter visual select mode", not as a prefix. I tried to first unbind 'v' using 'noop v'. This works to no longer trigger select mode, but it still doesn't allow me to use 'v' as a prefix key. I guess it is now explicitly bound to 'noop', which does nothing.

Is there currently a way to achieve what I want? If not, can a future version include some mechanism to delete existing bindings? This would be awesome.

@ahrm
Copy link
Owner

ahrm commented Nov 10, 2024

I think this is already fixed in the development branch.

@nzeh
Copy link
Author

nzeh commented Nov 10, 2024

Ah ok. Thanks. I'll have to install that one then. Any prediction when this will become stable?

@ahrm
Copy link
Owner

ahrm commented Nov 10, 2024

Unfortunately no.

@nzeh
Copy link
Author

nzeh commented Nov 10, 2024

That's fine. Thanks for sharing sioyek with the world.

@7910f6ba7ee4
Copy link

7910f6ba7ee4 commented Jan 24, 2025

I think this is already fixed in the development branch.

Using the development branch, still doesn't appear to be working. My specific usecase:

I'm binding move_right to o then binding open_document to x.

I would expect open_document to be overwritten, and move_right to stay. What happens is both o and x are bound to open_document and o is bound to move_right. When pressing o, it only activates open_document.

I have tried multiple position orders in keys_user.config as well as using the noop binding. The former has no effect and the latter only completely disables the key, which is not what I want.

Edit: fixed issue, seemed to be a comment interfering. For others, I am defining move_right first and open_document second, no noop.

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

3 participants