feat(ai): add avante.nvim

- Add proper lazy-loading with cmd and keys
- Move nui.nvim to separate spec with lazy=true
- Remove optional dependencies without configuration
- Keep only optional specs with actual config (img-clip, render-markdown, blink.cmp)
- Fix blink.cmp to use specs instead of dependencies

🤖 Action performed by [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Folke Lemaitre 2025-10-20 10:46:44 +02:00
parent b0a0a44f43
commit 2a14509903
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -1,66 +1,85 @@
return { return {
{ "MunifTanjim/nui.nvim", lazy = true },
{ {
"yetone/avante.nvim", "yetone/avante.nvim",
build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make", or "make",
event = "VeryLazy", event = "VeryLazy",
version = false,
opts = { opts = {
provider = "copilot", provider = "copilot",
selection = { selection = {
hint_display = "none", hint_display = "none",
}, },
}, },
dependencies = { cmd = {
"nvim-lua/plenary.nvim", "AvanteAsk",
"MunifTanjim/nui.nvim", "AvanteBuild",
"zbirenbaum/copilot.lua", "AvanteChat",
{ "nvim-mini/mini.pick", optional = true }, -- for file_selector provider mini.pick "AvanteClear",
{ "nvim-telescope/telescope.nvim", optional = true }, -- for file_selector provider telescope "AvanteEdit",
{ "hrsh7th/nvim-cmp", optional = true }, -- autocompletion for avante commands and mentions "AvanteFocus",
{ "ibhagwan/fzf-lua", optional = true }, -- for file_selector provider fzf "AvanteHistory",
{ "stevearc/dressing.nvim", optional = true }, -- for input provider dressing "AvanteModels",
{ "folke/snacks.nvim", optional = true }, -- for input provider snacks "AvanteRefresh",
{ "nvim-tree/nvim-web-devicons", optional = true }, -- or echasnovski/mini.icons "AvanteShowRepoMap",
{ "AvanteStop",
-- support for image pasting "AvanteSwitchProvider",
"HakonHarnes/img-clip.nvim", "AvanteToggle",
event = "VeryLazy", },
optional = true, keys = {
opts = { { "n", "<leader>aa", "<cmd>AvanteAsk<CR>", desc = "Ask Avante" },
-- recommended settings { "n", "<leader>ac", "<cmd>AvanteChat<CR>", desc = "Chat with Avante" },
default = { { "n", "<leader>ae", "<cmd>AvanteEdit<CR>", desc = "Edit Avante" },
embed_image_as_base64 = false, { "n", "<leader>af", "<cmd>AvanteFocus<CR>", desc = "Focus Avante" },
prompt_for_file_name = false, { "n", "<leader>ah", "<cmd>AvanteHistory<CR>", desc = "Avante History" },
drag_and_drop = { { "n", "<leader>am", "<cmd>AvanteModels<CR>", desc = "Select Avante Model" },
insert_mode = true, { "n", "<leader>an", "<cmd>AvanteChatNew<CR>", desc = "New Avante Chat" },
}, { "n", "<leader>ap", "<cmd>AvanteSwitchProvider<CR>", desc = "Switch Avante Provider" },
-- required for Windows users { "n", "<leader>ar", "<cmd>AvanteRefresh<CR>", desc = "Refresh Avante" },
use_absolute_path = true, { "n", "<leader>as", "<cmd>AvanteStop<CR>", desc = "Stop Avante" },
}, { "n", "<leader>at", "<cmd>AvanteToggle<CR>", desc = "Toggle Avante" },
},
},
-- support for image pasting
{
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
optional = true,
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
}, },
-- required for Windows users
use_absolute_path = true,
}, },
{ },
-- Make sure to set this up properly if you have lazy=true },
"MeanderingProgrammer/render-markdown.nvim",
optional = true, -- Make sure to set this up properly if you have lazy=true
opts = { {
file_types = { "markdown", "Avante" }, "MeanderingProgrammer/render-markdown.nvim",
}, optional = true,
ft = { "markdown", "Avante" }, opts = {
}, file_types = { "markdown", "Avante" },
{ },
"saghen/blink.cmp", ft = { "markdown", "Avante" },
optional = true, },
dependencies = {
"Kaiser-Yang/blink-cmp-avante", -- blink.cmp source for avante.nvim
}, {
opts = { "saghen/blink.cmp",
sources = { optional = true,
default = { "avante" }, specs = { "Kaiser-Yang/blink-cmp-avante" },
providers = { avante = { module = "blink-cmp-avante", name = "Avante" } }, opts = {
}, sources = {
}, default = { "avante" },
providers = { avante = { module = "blink-cmp-avante", name = "Avante" } },
}, },
}, },
}, },