aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj_sh6042026-06-07 14:50:22 -0400
committerkj_sh6042026-06-07 14:50:22 -0400
commit5243a73379855483ea22e07903528840361bcdc1 (patch)
tree5a567dbade2cea8a7018e707946612b624bef5d5
parenta2fdad205a29d1555ae5819e05eec80ceedcfc52 (diff)
refactor: minuet.ai instead of copilot + mojicrypt
Diffstat (limited to '')
-rw-r--r--.config/nvim/init.lua68
1 files 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", "<A-;>", ":tabmove -<CR>", { noremap = true })
keymap("n", "<A-'>", ":tabmove +<CR>", { noremap = true })
keymap("n", "<leader>ft", ":set filetype=", { noremap = true })
--- copilot
-keymap("i", "<A-a>", 'copilot#Accept("<CR>")', { expr = true, silent = true, replace_keycodes = false })
+-- copilot (disabled, using minuet-ai.nvim instead)
+-- keymap("i", "<A-a>", 'copilot#Accept("<CR>")', { 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 = "<A-CR>",
+ accept_line = "<A-a>",
+ accept_n_lines = "<A-S-CR>",
+ next = "<A-]>",
+ prev = "<A-[>",
+ dismiss = "<A-BS>",
+ },
+ },
+ 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