]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/bindings.go
Log erroneous keybindings
[micro.git] / cmd / micro / bindings.go
index b1d00c244da1f0322061755413d6d46c214a53a7..b537a9e12e9241082c1005e2baf533b0c7e63d2e 100644 (file)
@@ -52,8 +52,11 @@ var bindingActions = map[string]func(*View, bool) bool{
        "CutLine":             (*View).CutLine,
        "DuplicateLine":       (*View).DuplicateLine,
        "DeleteLine":          (*View).DeleteLine,
+       "MoveLinesUp":         (*View).MoveLinesUp,
+       "MoveLinesDown":       (*View).MoveLinesDown,
        "IndentSelection":     (*View).IndentSelection,
        "OutdentSelection":    (*View).OutdentSelection,
+       "OutdentLine":         (*View).OutdentLine,
        "Paste":               (*View).Paste,
        "PastePrimary":        (*View).PastePrimary,
        "SelectAll":           (*View).SelectAll,
@@ -72,6 +75,7 @@ var bindingActions = map[string]func(*View, bool) bool{
        "ClearStatus":         (*View).ClearStatus,
        "ShellMode":           (*View).ShellMode,
        "CommandMode":         (*View).CommandMode,
+       "Escape":              (*View).Escape,
        "Quit":                (*View).Quit,
        "QuitAll":             (*View).QuitAll,
        "AddTab":              (*View).AddTab,
@@ -336,6 +340,7 @@ func findAction(v string) (action func(*View, bool) bool) {
 func BindKey(k, v string) {
        key, ok := findKey(k)
        if !ok {
+               TermMessage("Unknown keybinding: " + k)
                return
        }
        if v == "ToggleHelp" {
@@ -364,6 +369,8 @@ func DefaultBindings() map[string]string {
                "ShiftRight":     "SelectRight",
                "AltLeft":        "WordLeft",
                "AltRight":       "WordRight",
+               "AltUp":          "MoveLinesUp",
+               "AltDown":        "MoveLinesDown",
                "AltShiftRight":  "SelectWordRight",
                "AltShiftLeft":   "SelectWordLeft",
                "CtrlLeft":       "StartOfLine",
@@ -375,13 +382,12 @@ func DefaultBindings() map[string]string {
                "CtrlShiftUp":    "SelectToStart",
                "CtrlShiftDown":  "SelectToEnd",
                "Enter":          "InsertNewline",
-               "Space":          "InsertSpace",
                "CtrlH":          "Backspace",
                "Backspace":      "Backspace",
                "Alt-CtrlH":      "DeleteWordLeft",
                "Alt-Backspace":  "DeleteWordLeft",
                "Tab":            "IndentSelection,InsertTab",
-               "Backtab":        "OutdentSelection",
+               "Backtab":        "OutdentSelection,OutdentLine",
                "CtrlO":          "OpenFile",
                "CtrlS":          "Save",
                "CtrlF":          "Find",
@@ -429,6 +435,6 @@ func DefaultBindings() map[string]string {
                "F4":  "Quit",
                "F7":  "Find",
                "F10": "Quit",
-               "Esc": "Quit",
+               "Esc": "Escape",
        }
 }