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

Consider mapping undo to C-z and redo to C-y to be similar to keybindings from other software #4034

Open
rmunn opened this issue Nov 4, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@rmunn
Copy link

rmunn commented Nov 4, 2024

Is your feature request related to a problem? Please describe.
It bothers me a little that undo is mapped to z while redo is mapped to C-z, because from years of dealing with other software I'm going to hit C-z by instinct when I want to undo something.

Describe the solution you'd like
I'd prefer if undo was C-z by default, while redo was C-y (there's a roughly even split between programs that use C-y for redo and those that use C-S-z for redo, but I've always preferred C-y). This would also require the current mapping of C-y (Copy pull request URL to clipboard) to be mapped to something else; C-u for URL is currently unused and could work.

Describe alternatives you've considered
I could, of course, remap these myself in config.yml, and probably will. But since the undo/redo feature is relatively new, it's probably not too late to change the default config, since not too many people will have gotten used to the current setup yet. So it's worth having a public discussion of whether people prefer the current keybindings, or whether more people would like C-z to mean "undo" and C-y to mean "redo".

@rmunn rmunn added the enhancement New feature or request label Nov 4, 2024
@rmunn
Copy link
Author

rmunn commented Nov 4, 2024

Unofficial poll, please vote with thumbs-up and thumbs-down responses to this comment (not the issue description):

👍 = I would prefer if C-z meant "undo" and C-y meant "redo"
👎 = I like the status quo where z means "undo" and C-z means "redo"

Note that a 👍 vote would also mean that "Copy pull request URL to clipboard" (which is currently C-y) would need to be changed to something else, so that the C-y keybinding would be freed up to mean "redo".

Edit: I have, of course, voted 👍 on this unofficial poll. 😀

@rmunn rmunn mentioned this issue Nov 4, 2024
@mark2185
Copy link
Collaborator

mark2185 commented Nov 4, 2024

@rmunn I suggest you change the keybindings on your end:

keybinding:
  universal:
    undo: '<c-z>'
    redo: '<c-y>'

The "undo/redo" feature has been available for at least 4 years so I don't think we can consider it "new".

@jbrains
Copy link
Contributor

jbrains commented Nov 4, 2024

Since lazygit is clearly inspired by vim, maybe the keybindings could match vim. Or even kakoune: u is undo and Shift+u is redo.

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

No branches or pull requests

3 participants