{"record":{"id":"ed3385a8e7f3cb1a","repo":"micro-editor/micro","slug":"s-is-not-a-bindable-event","errorCode":null,"errorMessage":"%s is not a bindable event","messagePattern":"(.+?) is not a bindable event","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/action/bindings.go","lineNumber":239,"sourceCode":"\t\t\tr:    rune(k[0]),\n\t\t}, true\n\t}\n\n\t// We don't know what happened.\n\treturn KeyEvent{}, false\n}\n\nfunc findEvent(k string) (Event, error) {\n\tvar event Event\n\tevent, ok, err := findEvents(k)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !ok {\n\t\tevent, ok = findSingleEvent(k)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(k + \" is not a bindable event\")\n\t\t}\n\t}\n\n\treturn event, nil\n}\n\nfunc eventsEqual(e1 Event, e2 Event) bool {\n\tseq1, ok1 := e1.(KeySequenceEvent)\n\tseq2, ok2 := e2.(KeySequenceEvent)\n\tif ok1 && ok2 {\n\t\tif len(seq1.keys) != len(seq2.keys) {\n\t\t\treturn false\n\t\t}\n\t\tfor i := 0; i < len(seq1.keys); i++ {\n\t\t\tif seq1.keys[i] != seq2.keys[i] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/micro-editor/micro/blob/1c8b82b32e408a5faf340039ed92d5266bea3293/internal/action/bindings.go#L221-L257","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use micro's exact event names: CtrlS (no separator), AltLeft, ShiftPageUp, Enter, Space, Tab, F5, MouseLeft, not 'ctrl+s' or 'Return'","Run > help keybindings for the authoritative list and the modifiers grammar","Check for pasted non-ASCII quotes/dashes in bindings.json (smart quotes break token names)","For plain characters bind the rune itself: \"x\": \"CursorRight\" style entries"],"exampleFix":"// before: ~/.config/micro/bindings.json\n\"ctrl+shift+p\": \"CommandMode\",\n\"Return\": \"Save\",\n\n// after\n\"CtrlP\": \"CommandMode\",\n\"Enter\": \"Save\",","handlingStrategy":"validation","validationCode":"// Reject unbindable keys before calling TryBindKey/UnbindKey\nvar knownMulti = map[string]bool{\"Enter\": true, \"Space\": true, \"Tab\": true, \"Esc\": true,\n    \"PageUp\": true, \"PageDown\": true, \"Home\": true, \"End\": true, \"Insert\": true,\n    \"Delete\": true, \"Backspace\": true, \"ArrowUp\": true, \"ArrowDown\": true,\n    \"ArrowLeft\": true, \"ArrowRight\": true, \"MouseLeft\": true, \"MouseMiddle\": true, \"MouseRight\": true}\nfunc bindable(k string) bool {\n    if len(k) == 1 { return true }                    // single rune\n    for _, p := range []string{\"Ctrl\", \"Alt\", \"Shift\"} { // strip modifiers\n        k = strings.TrimPrefix(k, p)\n    }\n    if len(k) == 1 { return true } // e.g. CtrlS\n    return knownMulti[k]           // or a whitelisted name\n}","typeGuard":null,"tryCatchPattern":"key, err := findEvent(k) // inside micro code; from Lua: pcall around bindings calls\nif err != nil {\n    if strings.HasSuffix(err.Error(), \"is not a bindable event\") {\n        return fmt.Errorf(\"check key name in > help keybindings: %s\", k)\n    }\n    return err\n}","preventionTips":["Keep a canonical list of valid event names next to your config generator","Beware 'ctrl+s' vs 'CtrlS' — micro uses no separators and capitalizes modifiers","Test the whole bindings.json once after edits by running one throwaway >bind"],"tags":["keybinding","config","parsing","validation"],"backgroundTag":null,"analyzedSha":"1c8b82b32e408a5faf340039ed92d5266bea3293","analyzedAt":"2026-08-15T20:01:45.134Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}