1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

feat: add support for emacs keybindings

This commit is contained in:
Ryooooooga 2022-09-23 20:04:39 +09:00
parent 1c82924307
commit 212e19f598
No known key found for this signature in database
GPG Key ID: 07CF200DFCC20C25

View File

@ -38,10 +38,16 @@ func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch
textArea.ToggleOverwrite()
case key == gocui.KeyCtrlU:
textArea.DeleteToStartOfLine()
case key == gocui.KeyCtrlK:
textArea.DeleteToEndOfLine()
case key == gocui.KeyCtrlA || key == gocui.KeyHome:
textArea.GoToStartOfLine()
case key == gocui.KeyCtrlE || key == gocui.KeyEnd:
textArea.GoToEndOfLine()
case key == gocui.KeyCtrlW:
textArea.BackSpaceWord()
case key == gocui.KeyCtrlY:
textArea.Yank()
// TODO: see if we need all three of these conditions: maybe the final one is sufficient
case ch != 0 && mod == 0 && unicode.IsPrint(ch):