From 212e19f598e9ea96939959f55a2cf7c422721212 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Fri, 23 Sep 2022 20:04:39 +0900 Subject: [PATCH] feat: add support for emacs keybindings --- pkg/gui/editors.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index 6f40c6d58..2fd606a3b 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -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):