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

Customize key binds #234

Merged
merged 15 commits into from
Aug 26, 2020
Merged

Customize key binds #234

merged 15 commits into from
Aug 26, 2020

Conversation

yanganto
Copy link
Contributor

Hi,
Thanks for providing the awesome git client with amazing terminal UI.
I am also a fan of neovim so I make a PR for customizing the key binds with vim style for this project.
This my first PR here, if there is something lacks consideration, please kindly tell me.
Thanks.

@extrawurst
Copy link
Owner

@yanganto wow thanks for going after this one, it's probably one of the most awaited feature! I will look at it in more depth later. The only thing that jumps out right away is the usage of a 'static reference, I wonder if we can clean this up🤔
Will ask in the discord for more people to give it a spin as I know there are people keen on this feature👍

@extrawurst
Copy link
Owner

The windows ci fails due to #235 nothing todo with this PR

@extrawurst
Copy link
Owner

@yanganto two more things: can you make the default key binding simply a default implementation in rust instead of a Schema that's loaded from Ron?
And instead of the lifetimes you can check out Interieur mutability in rust, we use it for the SharedTheme

@yanganto
Copy link
Contributor Author

  • The default key bind config is deleted, it may be misleading.
  • Let keybinds with interieur mutability.

@cruessler
Copy link
Contributor

I had a brief look at the PR using the vim-like config, and I very much like it! A few things:

  • focus_left and focus_right seem to be switched.
  • I would have expected page_up to be Ctrl+u and page_down to be Ctrl+d (the sample config seems to have them switched).
  • The hints at the bottom don’t reflect the changed config.

@yanganto
Copy link
Contributor Author

We may open another issue to fix the bottom hints. How do you think about this? @extrawurst

@extrawurst
Copy link
Owner

@yanganto can u rebase, then the windows ci should work again

@yanganto yanganto force-pushed the key-binds branch 6 times, most recently from b5c4784 to 0bb9498 Compare August 23, 2020 10:06
- uniform key config
- load key bindings from config
	- load key binding from key_config.ron
	- provide vim style sample config
- update README
- rm lazy_static
- remove default key config
- make keybinds with interieur mutability
- remove mutablility for keybinds
- fix vim style config
@extrawurst
Copy link
Owner

extrawurst commented Aug 25, 2020

Ok I think this is almost ready to be merged. Great work! I like the way you unified the key-definition and cmd-bar-text so that it automatically matches.

Just small things:

  • KEY_CONFIG.md now mentions a default-key-config that is not there. I think it makes sense that similarly to the color config on app start we dump the current key config into the config path. That way users can refer to that one and we automatically keep it up to date.
  • →d for capital D seems wrong (see screenshot 1)
  • why are many regular colons now a double colons (see screenshot 1 and 3)
  • why is the title text Help now lowercase? (see screenshot 1)
  • previous Details [enter] is now Details IDetails nspect [⏎] (see screenshot 2)
  • when inspecting a commit and focusing on the diff going back left does not work anymore (see screenshot 4)
  • title key for staged changes seems off (see screenshot 5)

screenshot 1 master (left) vs. PR (right):
key-bindings

screenshot 2:
Screenshot 2020-08-25 at 23 56 58

screenshot 3:
Screenshot 2020-08-26 at 00 00 43

screenshot 4:
Screenshot 2020-08-26 at 00 03 12

screenshot 5 (the s belongs inside the brackets):
Screenshot 2020-08-26 at 00 05 38

@yanganto
Copy link
Contributor Author

@extrawurst Thanks for your review. Everything is ready. I hope I can use this on on Archlinux soon :)

@extrawurst
Copy link
Owner

  • Arrow left in diff to go back to the file tree still does not work. maybe the diff eats the event so that it does not bubble up to the inspect component?
  • →d for capital D is still wrong (see screenshot 1)

@extrawurst extrawurst merged commit a95ffd7 into extrawurst:master Aug 26, 2020
@extrawurst
Copy link
Owner

It is merged! Thanks @yanganto for this great effort - many people will be happy with this!❤️

@extrawurst extrawurst mentioned this pull request Aug 26, 2020
@yanganto
Copy link
Contributor Author

@extrawurst Thanks for review this. <3

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

Successfully merging this pull request may close these issues.

Ctrl+U and Ctrl+D for page up/down different key binding presets
3 participants