From 5243a73379855483ea22e07903528840361bcdc1 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 7 Jun 2026 14:50:22 -0400 Subject: refactor: minuet.ai instead of copilot + mojicrypt --- .config/nvim/init.lua | 68 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 4427ca1..cebdaf7 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,7 +1,8 @@ -- plugins vim.cmd [[ call plug#begin() - Plug 'github/copilot.vim' + " Plug 'github/copilot.vim' + Plug 'milanglacier/minuet-ai.nvim' Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-path' @@ -138,8 +139,8 @@ keymap("n", "", ":tabmove -", { noremap = true }) keymap("n", "", ":tabmove +", { noremap = true }) keymap("n", "ft", ":set filetype=", { noremap = true }) --- copilot -keymap("i", "", 'copilot#Accept("")', { expr = true, silent = true, replace_keycodes = false }) +-- copilot (disabled, using minuet-ai.nvim instead) +-- keymap("i", "", 'copilot#Accept("")', { expr = true, silent = true, replace_keycodes = false }) -- ui and colors vim.cmd("colorscheme kijish") @@ -379,3 +380,64 @@ if ok_cmp then }), }) end + +-- minuet (ai completions via openrouter) +local _enc = vim.fn.expand("~/.config/minuet/key") +local _ukey = vim.fn.expand("~/.config/minuet/mojicrypt.ukey") + +if vim.fn.filereadable(_enc) == 1 and vim.fn.filereadable(_ukey) == 1 then + local ok_minuet, minuet = pcall(require, "minuet") + if ok_minuet then + minuet.setup({ + provider = "openai_compatible", + virtualtext = { + auto_trigger_ft = { "*" }, + keymap = { + accept = "", + accept_line = "", + accept_n_lines = "", + next = "", + prev = "", + dismiss = "", + }, + }, + request_timeout = 2.5, + throttle = 1500, + debounce = 600, + provider_options = { + openai_compatible = { + api_key = (function() + local cached + return function() + if not cached then + local result = vim.fn.system({ + "/home/kylert/.local/bin/mojicrypt", "decrypt", + "-f", _enc, + "-k", _ukey, + "-o", "/dev/stdout", + }) + if vim.v.shell_error == 0 then + cached = result:gsub("%s+", "") + else + cached = "" + end + end + return cached ~= "" and cached or nil + end + end)(), + end_point = "https://openrouter.ai/api/v1/chat/completions", + model = "gpt-oss-120b", + name = "Openrouter", + optional = { + max_tokens = 128, + top_p = 0.9, + provider = { + sort = "throughput", + }, + reasoning_effort = "minimal", + }, + }, + }, + }) + end +end -- cgit v1.2.3