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

Support key binds mapping #15

Closed
5 tasks done
yanganto opened this issue Jul 31, 2024 · 6 comments · Fixed by #21
Closed
5 tasks done

Support key binds mapping #15

yanganto opened this issue Jul 31, 2024 · 6 comments · Fixed by #21
Labels
enhancement New feature or request

Comments

@yanganto
Copy link
Contributor

yanganto commented Jul 31, 2024

Hi there,
Thanks for providing this, the git log view is awesome. Flexible keybinding can make this project better and more popular.

I love to work on this issue, and I also have experience with this.

What I want to implement are

  • a vim style default keybinding
  • read a keybinding config then patch on the default, so the user can modify part of key binds not always all
  • the config is toml, because we already use toml = "0.8.16" and it will be easier to write comments in the config file

The following are possible optional features with event abstract layer

  • Abstract events, so the user can customize one or multiple key binds with the same event, ex <Ctrl-c> <q> for quitting app
  • Print help from the Display of an event, so the help will always be the same as the key bind to avoid typos. The typos make it possible to let the key binds document in help different from the actual key binds used and let people confuse.

Do these ideas look good to you? If these are good, I am happy to work on them and can discuss them in the PR later.

By the way, if it is good I'd like to make the wordings with i10n, and it can be tracked in another issue.

@lusingander
Copy link
Owner

I think this is very cool.
I thought it would be a good to have this as well, but it's a lot of work so I haven't implemented it yet.

And it seems to me that the points you have given cover almost everything there is to consider. So it looks good.

By the way, if it is good I'd like to make the wordings with i10n, and it can be tracked in another issue.

It seems like a useful feature, but we should consider whether we want to implement it right away.

At least for now, it's not a complex application and I'm not sure how many users would be interested, so I'm worried that this will become unnecessarily complicated.

@lusingander lusingander added the enhancement New feature or request label Jul 31, 2024
@edte
Copy link

edte commented Aug 3, 2024

Want to support git log-like d and u movement keys

@lusingander
Copy link
Owner

lusingander commented Aug 4, 2024

Want to support git log-like d and u movement keys

Are you referring to using a pager such as less rather than git log? Is Ctrl-d/u not enough? @edte

@yanganto
Copy link
Contributor Author

yanganto commented Aug 4, 2024

Hi @edte
The following is the example you can have ctrl-u and ctrl-d key inputs as you wish with #21.

  1. $ mkdir ~/.config/serie

  2. create ~/.config/serie/config.toml with the following content

[custom_keybind_patch]
NavigateUp = ["ctrl-u"]
NavigateDown = ["ctrl-d"]

I already tested these steps, if you have suggestions please let me know, and we can make this better. 😄

@edte
Copy link

edte commented Aug 5, 2024

Want to support git log-like d and u movement keys

Are you referring to using a pager such as less rather than git log? Is Ctrl-d/u not enough? @edte

Yes, u and d are aliases of ctrl-u and ctrl-d, I think these two are more convenient

Hi @edte The following is the example you can have ctrl-u and ctrl-d key inputs as you wish with #21.

  1. $ mkdir ~/.config/serie
  2. create ~/.config/serie/config.toml with the following content
[custom_keybind_patch]
NavigateUp = ["ctrl-u"]
NavigateDown = ["ctrl-d"]

I already tested these steps, if you have suggestions please let me know, and we can make this better. 😄

hello,config this like doesn't seem to work

[custom_keybind_patch]
NavigateUp = ["u"]
NavigateDown = ["d"]

@yanganto
Copy link
Contributor Author

yanganto commented Aug 6, 2024

hello,config this like doesn't seem to work

[custom_keybind_patch]
NavigateUp = ["u"]
NavigateDown = ["d"]

Hi @edte,
Please double-check that you are using binary from #21 and use ? to see the keybind?
It works with u and d with #21.
u-d

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

Successfully merging a pull request may close this issue.

3 participants