add deepseek
This commit is contained in:
@@ -62,11 +62,16 @@ map("n", "<leader>hn", function() require("harpoon"):list():next() end, { d
|
||||
map("n", "-", "<cmd>Oil<cr>", { desc = "Open parent dir (Oil)" })
|
||||
map("n", "<leader>oo", "<cmd>Oil --float<cr>", { desc = "Oil (float)" })
|
||||
|
||||
-- ── AI (Minuet inline completions) ───────────────────────────────────────────
|
||||
map("i", "<A-m>", function() require("minuet").make_cmp_map() end, { desc = "Minuet: trigger completion" })
|
||||
map("n", "<A-m>", function() require("minuet").complete_with_minuet() end, { desc = "Minuet: inline suggestion" })
|
||||
|
||||
-- ── which-key group labels ────────────────────────────────────────────────────
|
||||
vim.schedule(function()
|
||||
local ok, wk = pcall(require, "which-key")
|
||||
if not ok then return end
|
||||
wk.add {
|
||||
{ "<leader>a", group = "AI" },
|
||||
{ "<leader>d", group = "Debug" },
|
||||
{ "<leader>dg", group = "Go" },
|
||||
{ "<leader>x", group = "Diagnostics" },
|
||||
|
||||
@@ -110,6 +110,83 @@ return {
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- ── AI ───────────────────────────────────────────────────────────────────────
|
||||
|
||||
-- Avante: AI sidebar chat + inline editing (DeepSeek)
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
build = "make",
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = { file_types = { "markdown", "Avante" } },
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
provider = "deepseek",
|
||||
providers = {
|
||||
deepseek = {
|
||||
__inherited_from = "openai",
|
||||
api_key_name = "cmd:grep -m1 DEEPSEEK_API_KEY ~/.bashrc | grep -oP '(?<=\")[^\"]*(?=\")'",
|
||||
endpoint = "https://api.deepseek.com/v1",
|
||||
model = "deepseek-chat",
|
||||
extra_request_body = { temperature = 0, max_tokens = 8192 },
|
||||
},
|
||||
},
|
||||
-- Use dressing for concealed API-key prompts (native provider has a bug)
|
||||
input = { provider = "dressing" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("avante").setup(opts)
|
||||
-- DeepSeek is a REST API provider, not an ACP agent — remove ACP-only keys
|
||||
pcall(vim.keymap.del, "n", "<leader>aM")
|
||||
pcall(vim.keymap.del, "n", "<leader>am")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Minuet: inline ghost-text completions (DeepSeek via OpenAI-compat endpoint)
|
||||
{
|
||||
"milanglacier/minuet-ai.nvim",
|
||||
event = "BufReadPost",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
provider = "openai_compatible",
|
||||
provider_options = {
|
||||
openai_compatible = {
|
||||
api_key = "DEEPSEEK_API_KEY",
|
||||
end_point = "https://api.deepseek.com/chat/completions",
|
||||
model = "deepseek-chat",
|
||||
name = "DeepSeek",
|
||||
optional = { max_tokens = 256, top_p = 0.9 },
|
||||
},
|
||||
},
|
||||
virtualtext = {
|
||||
auto_trigger_ft = {}, -- manual trigger only (<A-m>)
|
||||
keymap = {
|
||||
accept = "<A-l>",
|
||||
accept_line = "<A-j>",
|
||||
prev = "<A-[>",
|
||||
next = "<A-]>",
|
||||
dismiss = "<A-e>",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Expose minuet as a nvim-cmp source
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "minuet" })
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
|
||||
-- Oil: edit the filesystem like a buffer
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
|
||||
Reference in New Issue
Block a user