micro-editor/micro · error
Plugin %s does not exist
Error message
Plugin %s does not exist
What it means
Returned by config.PluginAddRuntimeFile — the Go backend of the Lua AddRuntimeFile API — when FindPlugin(plugin) returns nil, i.e. no loaded plugin has the given name. The plugin was trying to register a runtime file (colorscheme, syntax, ftplugin, etc.) under a plugin identity micro does not know.
Source
Thrown at internal/config/rtfiles.go:296
}
return ""
}
// PluginListRuntimeFiles allows plugins to lists all runtime files of the given type
func PluginListRuntimeFiles(fileType RTFiletype) []string {
files := ListRuntimeFiles(fileType)
result := make([]string, len(files))
for i, f := range files {
result[i] = f.Name()
}
return result
}
// PluginAddRuntimeFile adds a file to the runtime files for a plugin
func PluginAddRuntimeFile(plugin string, filetype RTFiletype, filePath string) error {
pl := FindPlugin(plugin)
if pl == nil {
return errors.New("Plugin " + plugin + " does not exist")
}
pldir := pl.DirName
fullpath := filepath.Join(ConfigDir, "plug", pldir, filePath)
if _, err := os.Stat(fullpath); err == nil {
AddRealRuntimeFile(filetype, realFile(fullpath))
} else {
fullpath = filepath.Join("runtime", "plugins", pldir, filePath)
AddRuntimeFile(filetype, assetFile(fullpath))
}
return nil
}
// PluginAddRuntimeFilesFromDirectory adds files from a directory to the runtime files for a plugin
func PluginAddRuntimeFilesFromDirectory(plugin string, filetype RTFiletype, directory, pattern string) error {
pl := FindPlugin(plugin)
if pl == nil {
return errors.New("Plugin " + plugin + " does not exist")
}View on GitHub (pinned to 1c8b82b32e)
Solutions
- Make the name string exactly equal to the plugin's folder name under ~/.config/micro/plug/ (case-sensitive).
- Prefer not hardcoding: in the plugin repo the canonical pattern is AddRuntimeFile(plugin_name, ...) where plugin_name comes from the repo layout — keep them in sync.
- Verify the plugin actually loaded: check `micro -version`/plugin listing or look for load errors on startup.
- If the plugin is optional, wrap the Lua call in pcall to degrade gracefully.
Example fix
-- before (~/.config/micro/plug/MyPlug/init.lua):
AddRuntimeFile('myplug', RTSYNTAX, 'syntax.yaml')
-- after (folder is MyPlug):
AddRuntimeFile('MyPlug', RTSYNTAX, 'syntax.yaml') Defensive patterns
Strategy: validation
Validate before calling
-- inside init.lua, before registering files:
local ok = pcall(function() return GetPlugin(pluginName) end)
-- or simply align the string with the folder name and wrap:
local ok, err = pcall(AddRuntimeFile, "MyPlug", RTSYNTAX, "syntax.yaml")
if not ok then print("AddRuntimeFile failed: " .. tostring(err)) end Try / catch
-- Lua caller wraps the API in pcall: local ok, err = pcall(AddRuntimeFile, pluginName, RTCOLORSCHEME, "scheme.micro") if not ok then -- err contains 'Plugin <name> does not exist': fix name or skip registration end
Prevention
- Keep the plugin's folder name and every name string in its init.lua byte-identical (case matters).
- Never copy AddRuntimeFile lines between plugins without updating the name argument.
- Check the plugin actually loaded (no startup plugin errors) before expecting registration calls to succeed.
When it happens
Trigger: A plugin's init.lua calling AddRuntimeFile('myplugin', RTCOLORSCHEME, 'colors.my.micro') where the installed folder name differs (case-sensitive!) from 'myplugin', or the call happening for a plugin that failed/is not loaded. FindPlugin matches the plugin's registered name at internal/config/rtfiles.go:296.
Common situations: Renaming a plugin's directory without updating init.lua strings, copy-pasting AddRuntimeFile boilerplate between plugins, or plugin renamed upstream while the user kept an old fork with hardcoded names.
Related errors
AI-assisted analysis of micro-editor/micro@1c8b82b32e (2026-08-15).
Data as JSON: /api/errors/315108e9ed1c1a91.
Report an issue: GitHub.