diff --git a/common/nvim/init.lua b/common/nvim/init.lua index 87db4b7..2a3699c 100755 --- a/common/nvim/init.lua +++ b/common/nvim/init.lua @@ -167,7 +167,14 @@ if not minuet_base or minuet_base == "" then minuet_base = "https://llm.rcjohnstone.com" end -require("minuet").setup({ +-- ⚠ pcall, because a hard require here takes the WHOLE config down with it. +-- `vim.pack.add` installs on first launch, and that needs to reach github -- +-- which is not a given on a work-issued machine behind a proxy. Without this, +-- a failed install means no MinuetStatus, no colorscheme, no anything below +-- this line, and an error that points at minuet rather than at the network. +local minuet_ok, minuet = pcall(require, "minuet") +if minuet_ok then +minuet.setup({ provider = "openai_fim_compatible", -- Default is 'warn', which hides request failures. If completions stop -- appearing, set this to 'debug' and the reason shows up in `:messages`. @@ -222,11 +229,15 @@ require("minuet").setup({ }, }, }) +end --- Because "is it on, and if not why" should be answerable without reading Lua. +-- Registered UNCONDITIONALLY, so it can report the case where the plugin +-- itself is missing. A status command that only exists when everything +-- already works is not a status command. vim.api.nvim_create_user_command("MinuetStatus", function() local k = minuet_key() local lines = { + "plugin: " .. (minuet_ok and "loaded" or "NOT INSTALLED -- run :lua vim.pack.update()"), "endpoint: " .. minuet_base .. "/v1/completions", "model: qwen3-coder-30b", "key: " .. (k and ("found (" .. #k .. " chars)") or "NOT FOUND"),