lazygit
lazygit copied to clipboard
Feat: Allow emacs character navigation in the commit editor.
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.
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
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)
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 :)
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.
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.
@Ryooooooga could you weigh in on this PR: how does it relate to your recent emacs keybindings PR?
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.
Very well! Thanks for making this @LiamKearn