Skip to content

different key binding presets #57

Closed

Description

@extrawurst

based off of #43 there is still the open issue of how to support different key bindings like vim,emacs and nano. I need input on those, cause I don't use them at all.

The most flexible solution would be having gitui dump the default bindings into a config file (on first run) and load it on startup so people can alter it.

My plan is to do it in 2 bigger changes:

1. make key bindings dynamic

  • refactor the key constants into a type KeyBindings
  • change all the pattern matching on CT constants for the bindings currently to be done using runtime variables from the KeyBindings
  • refactor commands::CommandText to be dynamic since they reference the keys

2. allow changing the bindings

  • enable serde feature in crossterm to be able to serialise them
  • use ron to load/save KeyBindings

Activity

  1. added
    enhancement
    good first issue
    and removed
    good first issue
    on May 14, 2020
  2. hkdobrev commented on May 17, 2020

    @hkdobrev

    👍

    What I've found strange immediately after starting gitui was the different style in key bindings among them. The most stark was using letters for everything, but exiting with Ctrl-c. Most command-line tools taking over the entire screen like that exit with q. git add --interactive also quits with q Enter.

    Do you think these could be unified? Thanks!

  3. extrawurst commented on May 17, 2020

    @extrawurst
    CollaboratorAuthor

    Hey @hkdobrev thanks for your interest in gitui ❤️.

    Before Quit was bound to the q key but that did not work in the commit popup, so I added Esc which bugged me because I prefer consistency. Then I got complaints that it is standard to support ctrl+c so I switched it to being the Quit binding.

    Ultimately there is no single key bindings that satisfy everyone. This ticket and #43 shows that. The big advantage of gitui is that even if they are odd the bindings are always clearly communicated and nothing to learn from man files.

    Anyhow I hope solving this issue will allow you to setup any bindings you like :)

  4. stale commented on Aug 15, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  5. added
    wontfix
    on Aug 15, 2020
  6. removed
    wontfix
    on Aug 16, 2020
  7. wezm commented on Aug 18, 2020

    @wezm
    Contributor

    Just bumping this to stop the bot from closing.

  8. lucax88x commented on Aug 18, 2020

    @lucax88x

    Top this, awesome tool and those binding would make it favourite.

  9. added this to the v0.10 milestone on Aug 18, 2020
  10. extrawurst commented on Aug 18, 2020

    @extrawurst
    CollaboratorAuthor

    Good news! Thanks to @yanganto this is actually on the way. Please checkout the branch (#234) and let us know what you think and how you like it so we meet the many expectations :)

  11. tony commented on Jan 30, 2022

    @tony
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions