From 2a145099033fadd10515623df70191e34c92c038 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Oct 2025 10:46:44 +0200 Subject: [PATCH] feat(ai): add avante.nvim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- lua/lazyvim/plugins/extras/ai/avante.lua | 117 +++++++++++++---------- 1 file changed, 68 insertions(+), 49 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/avante.lua b/lua/lazyvim/plugins/extras/ai/avante.lua index a15741bd..2a11c87d 100644 --- a/lua/lazyvim/plugins/extras/ai/avante.lua +++ b/lua/lazyvim/plugins/extras/ai/avante.lua @@ -1,66 +1,85 @@ return { + { "MunifTanjim/nui.nvim", lazy = true }, + { "yetone/avante.nvim", build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" or "make", event = "VeryLazy", - version = false, opts = { provider = "copilot", selection = { hint_display = "none", }, }, - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "zbirenbaum/copilot.lua", - { "nvim-mini/mini.pick", optional = true }, -- for file_selector provider mini.pick - { "nvim-telescope/telescope.nvim", optional = true }, -- for file_selector provider telescope - { "hrsh7th/nvim-cmp", optional = true }, -- autocompletion for avante commands and mentions - { "ibhagwan/fzf-lua", optional = true }, -- for file_selector provider fzf - { "stevearc/dressing.nvim", optional = true }, -- for input provider dressing - { "folke/snacks.nvim", optional = true }, -- for input provider snacks - { "nvim-tree/nvim-web-devicons", optional = true }, -- or echasnovski/mini.icons - { - -- 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, - }, + cmd = { + "AvanteAsk", + "AvanteBuild", + "AvanteChat", + "AvanteClear", + "AvanteEdit", + "AvanteFocus", + "AvanteHistory", + "AvanteModels", + "AvanteRefresh", + "AvanteShowRepoMap", + "AvanteStop", + "AvanteSwitchProvider", + "AvanteToggle", + }, + keys = { + { "n", "aa", "AvanteAsk", desc = "Ask Avante" }, + { "n", "ac", "AvanteChat", desc = "Chat with Avante" }, + { "n", "ae", "AvanteEdit", desc = "Edit Avante" }, + { "n", "af", "AvanteFocus", desc = "Focus Avante" }, + { "n", "ah", "AvanteHistory", desc = "Avante History" }, + { "n", "am", "AvanteModels", desc = "Select Avante Model" }, + { "n", "an", "AvanteChatNew", desc = "New Avante Chat" }, + { "n", "ap", "AvanteSwitchProvider", desc = "Switch Avante Provider" }, + { "n", "ar", "AvanteRefresh", desc = "Refresh Avante" }, + { "n", "as", "AvanteStop", desc = "Stop Avante" }, + { "n", "at", "AvanteToggle", 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, - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - { - "saghen/blink.cmp", - optional = true, - dependencies = { - "Kaiser-Yang/blink-cmp-avante", - }, - opts = { - sources = { - default = { "avante" }, - providers = { avante = { module = "blink-cmp-avante", name = "Avante" } }, - }, - }, + }, + }, + + -- Make sure to set this up properly if you have lazy=true + { + "MeanderingProgrammer/render-markdown.nvim", + optional = true, + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + + -- blink.cmp source for avante.nvim + { + "saghen/blink.cmp", + optional = true, + specs = { "Kaiser-Yang/blink-cmp-avante" }, + opts = { + sources = { + default = { "avante" }, + providers = { avante = { module = "blink-cmp-avante", name = "Avante" } }, }, }, },