micro-editor/micro · error

%s is not a bindable event

Error message

%s is not a bindable event

What it means

Returned by findEvent() (internal/action/bindings.go:239) when the string is not a <...> sequence (findEvents returns ok=false) AND findSingleEvent also cannot interpret it. findSingleEvent fails when, after stripping Ctrl/Alt/Shift/dash prefixes, the remainder is empty, is a multi-character name absent from keyEvents/mouseEvents, or is not a valid mouse suffix form. This is the generic 'this key name does not exist' error for every bind/unbind path.

Source

Thrown at internal/action/bindings.go:239

			r:    rune(k[0]),
		}, true
	}

	// We don't know what happened.
	return KeyEvent{}, false
}

func findEvent(k string) (Event, error) {
	var event Event
	event, ok, err := findEvents(k)
	if err != nil {
		return nil, err
	}

	if !ok {
		event, ok = findSingleEvent(k)
		if !ok {
			return nil, errors.New(k + " is not a bindable event")
		}
	}

	return event, nil
}

func eventsEqual(e1 Event, e2 Event) bool {
	seq1, ok1 := e1.(KeySequenceEvent)
	seq2, ok2 := e2.(KeySequenceEvent)
	if ok1 && ok2 {
		if len(seq1.keys) != len(seq2.keys) {
			return false
		}
		for i := 0; i < len(seq1.keys); i++ {
			if seq1.keys[i] != seq2.keys[i] {
				return false
			}
		}

View on GitHub (pinned to 1c8b82b32e)

Solutions

  1. Use micro's exact event names: CtrlS (no separator), AltLeft, ShiftPageUp, Enter, Space, Tab, F5, MouseLeft, not 'ctrl+s' or 'Return'
  2. Run > help keybindings for the authoritative list and the modifiers grammar
  3. Check for pasted non-ASCII quotes/dashes in bindings.json (smart quotes break token names)
  4. For plain characters bind the rune itself: "x": "CursorRight" style entries

Example fix

// before: ~/.config/micro/bindings.json
"ctrl+shift+p": "CommandMode",
"Return": "Save",

// after
"CtrlP": "CommandMode",
"Enter": "Save",
Defensive patterns

Strategy: validation

Validate before calling

// Reject unbindable keys before calling TryBindKey/UnbindKey
var knownMulti = map[string]bool{"Enter": true, "Space": true, "Tab": true, "Esc": true,
    "PageUp": true, "PageDown": true, "Home": true, "End": true, "Insert": true,
    "Delete": true, "Backspace": true, "ArrowUp": true, "ArrowDown": true,
    "ArrowLeft": true, "ArrowRight": true, "MouseLeft": true, "MouseMiddle": true, "MouseRight": true}
func bindable(k string) bool {
    if len(k) == 1 { return true }                    // single rune
    for _, p := range []string{"Ctrl", "Alt", "Shift"} { // strip modifiers
        k = strings.TrimPrefix(k, p)
    }
    if len(k) == 1 { return true } // e.g. CtrlS
    return knownMulti[k]           // or a whitelisted name
}

Try / catch

key, err := findEvent(k) // inside micro code; from Lua: pcall around bindings calls
if err != nil {
    if strings.HasSuffix(err.Error(), "is not a bindable event") {
        return fmt.Errorf("check key name in > help keybindings: %s", k)
    }
    return err
}

Prevention

When it happens

Trigger: Calling >bind WrongName Save, putting "Hell": "Save" in bindings.json, or binding "Ctrl" alone (empty remainder). Any multi-character event name not present in the keyEvents/mouseEvents tables (e.g. "Return" instead of "Enter", "Escape" vs "Esc" depending on table) produces it.

Common situations: Porting configs from VS Code/Vim key notation (e.g. 'ctrl+shift+p', 'leader w') into micro; plugins binding to keys renamed across micro versions; invisible whitespace or smart quotes pasted into bindings.json.

Related errors


AI-assisted analysis of micro-editor/micro@1c8b82b32e (2026-08-15). Data as JSON: /api/errors/ed3385a8e7f3cb1a. Report an issue: GitHub.