Skip to content

Commit 212e19f

Browse files
committed
feat: add support for emacs keybindings
1 parent 1c82924 commit 212e19f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/gui/editors.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch
3838
textArea.ToggleOverwrite()
3939
case key == gocui.KeyCtrlU:
4040
textArea.DeleteToStartOfLine()
41+
case key == gocui.KeyCtrlK:
42+
textArea.DeleteToEndOfLine()
4143
case key == gocui.KeyCtrlA || key == gocui.KeyHome:
4244
textArea.GoToStartOfLine()
4345
case key == gocui.KeyCtrlE || key == gocui.KeyEnd:
4446
textArea.GoToEndOfLine()
47+
case key == gocui.KeyCtrlW:
48+
textArea.BackSpaceWord()
49+
case key == gocui.KeyCtrlY:
50+
textArea.Yank()
4551

4652
// TODO: see if we need all three of these conditions: maybe the final one is sufficient
4753
case ch != 0 && mod == 0 && unicode.IsPrint(ch):

0 commit comments

Comments
 (0)