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

different key binding presets #57

Closed
extrawurst opened this issue May 14, 2020 · 7 comments · Fixed by #234
Closed

different key binding presets #57

extrawurst opened this issue May 14, 2020 · 7 comments · Fixed by #234
Labels
enhancement New feature or request
Milestone

Comments

@extrawurst
Copy link
Owner

extrawurst commented May 14, 2020

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
@extrawurst extrawurst added enhancement New feature or request good first issue Good for newcomers and removed good first issue Good for newcomers labels May 14, 2020
@hkdobrev
Copy link

👍

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!

@extrawurst
Copy link
Owner Author

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 :)

@stale
Copy link

stale bot commented Aug 15, 2020

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.

@stale stale bot added the wontfix This will not be worked on label Aug 15, 2020
@extrawurst extrawurst removed the wontfix This will not be worked on label Aug 16, 2020
@wezm
Copy link
Contributor

wezm commented Aug 18, 2020

Just bumping this to stop the bot from closing.

@lucax88x
Copy link

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

@extrawurst extrawurst added this to the v0.10 milestone Aug 18, 2020
@extrawurst
Copy link
Owner Author

extrawurst commented Aug 18, 2020

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 :)

@tony
Copy link

tony commented Jan 30, 2022

For vim-style keybindings, see https://github.com/extrawurst/gitui/blob/master/KEY_CONFIG.md or #1114

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.

5 participants