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

Feat: Allow emacs character navigation in the commit editor. #2104

Merged
merged 1 commit into from
Sep 24, 2022
Merged

Feat: Allow emacs character navigation in the commit editor. #2104

merged 1 commit into from
Sep 24, 2022

Conversation

LiamKearn
Copy link
Contributor

Haven't used go before, testing the waters a little before thinking about a contribution.

This feels like something not a lot of people would use so would there be room open for customisation of these bindings? What is the general stance on keyboard shortcuts / how flexible would we be to something like jumping/deleting words in the commit editor?

Out of curiosity where else in the application would this keypress handling be used? I can see one call to handleEditorKeypress in commitMessageEditor. The gui's PopupHandler stuff seems a bit more open ended and complex for me right now.

I understand most people want to open their $VISUAL or $EDITOR but for me personally having the context (diff/reflog etc) in the background and using a popup is more efficient most of time.

@mark2185
Copy link
Collaborator

mark2185 commented Aug 9, 2022

Related discussions: #1783 , #795.

I understand most people want to open their $VISUAL or $EDITOR but for me personally having the context (diff/reflog etc) in the background and using a popup is more efficient most of time.

Try adding this to your gitconfig and using the external editor:

[commit]
	verbose = true

@jesseduffield
Copy link
Owner

I'm happy to add these keybindings as the existing ones have limited support across terminals. But yes it would be good to make all the keybindings in handleEditorKeypress configurable (though happy to have some sane defaults and that includes emacs keybindings)

@LiamKearn
Copy link
Contributor Author

Try adding this to your gitconfig and using the external editor.

I didn't know there was a gitconfig for that I'm in the habbit of using status -v and commit -v but I hadn't seen that before. I'll be adding that my config.

I'm still however a sucker for the default commit editor. I might have a look into those other two issues thanks :)

@mark2185
Copy link
Collaborator

mark2185 commented Aug 9, 2022

I'm still however a sucker for the default commit editor. I might have a look into those other two issues thanks :)

It sure is comfy, until you need a multiline message.

@LiamKearn
Copy link
Contributor Author

I'm still however a sucker for the default commit editor. I might have a look into those other two issues thanks :)

It sure is comfy, until you need a multiline message.

Yeah can't argue against using $EDITOR for that. #1783 is cool but IMO if you're editing that much text you should use an editor.

I think shortcuts are different here, They still preserve the visual UX and make the non EDITOR experience better.

@jesseduffield
Copy link
Owner

@Ryooooooga could you weigh in on this PR: how does it relate to your recent emacs keybindings PR?

@Ryooooooga
Copy link
Contributor

This PR is about a similar interest to #2183, but is independent.

But yes it would be good to make all the keybindings in handleEditorKeypress configurable

I agree with that.

@jesseduffield jesseduffield merged commit 1d40bd1 into jesseduffield:master Sep 24, 2022
@jesseduffield
Copy link
Owner

Very well! Thanks for making this @LiamKearn

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.

4 participants