Add some default readline bindings

This commit is contained in:
Kovid Goyal 2022-10-07 07:28:21 +05:30
parent 27418eed88
commit fd36435262
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -13,13 +13,23 @@ var _ = fmt.Print
var default_shortcuts = map[string]Action{
"backspace": ActionBackspace,
"ctrl+h": ActionBackspace,
"delete": ActionDelete,
"home": ActionMoveToStartOfLine,
"end": ActionMoveToEndOfLine,
"ctrl+d": ActionDelete,
"home": ActionMoveToStartOfLine,
"ctrl+a": ActionMoveToStartOfLine,
"end": ActionMoveToEndOfLine,
"ctrl+e": ActionMoveToEndOfLine,
"ctrl+home": ActionMoveToStartOfDocument,
"ctrl+end": ActionMoveToEndOfDocument,
"left": ActionCursorLeft,
"right": ActionCursorRight,
"left": ActionCursorLeft,
"ctrl+b": ActionCursorLeft,
"right": ActionCursorRight,
"ctrl+f": ActionCursorRight,
}
func action_for_key_event(event *loop.KeyEvent, shortcuts map[string]Action) Action {