Skip to content

Support key binds mapping #15

Closed

Description

@yanganto

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.

Activity

  1. lusingander commented on Jul 31, 2024

    @lusingander
    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.

  2. added
    enhancement
    on Jul 31, 2024
  3. edte commented on Aug 3, 2024

    @edte

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

  4. lusingander commented on Aug 4, 2024

    @lusingander
    Owner

    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

  5. yanganto commented on Aug 4, 2024

    @yanganto
    ContributorAuthor

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

  6. edte commented on Aug 5, 2024

    @edte

    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"]
    
  7. yanganto commented on Aug 6, 2024

    @yanganto
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions