From 71abc5037547c1c6eefb6a8337edc8e5d1e16e48 Mon Sep 17 00:00:00 2001 From: Ernest Date: Sun, 29 Jun 2025 13:33:15 +0200 Subject: [PATCH] Clean up avante.lua configuration - Remove unnecessary comments and verbose explanations - Remove commented-out img-clip.nvim dependency - Simplify dependency declarations - Keep essential functionality intact --- lua/custom/plugins/avante.lua | 37 ++++++----------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/lua/custom/plugins/avante.lua b/lua/custom/plugins/avante.lua index 283a9c44b1d..d393e3c3983 100644 --- a/lua/custom/plugins/avante.lua +++ b/lua/custom/plugins/avante.lua @@ -1,9 +1,6 @@ return { 'yetone/avante.nvim', - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - -- ⚠️ must add this setting! ! ! build = function() - -- conditionally use the correct build system for the current OS if vim.fn.has 'win32' == 1 then return 'powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false' else @@ -11,7 +8,7 @@ return { end end, event = 'VeryLazy', - version = false, -- Never set this value to "*"! Never! + version = false, ---@module 'avante' ---@type avante.Config opts = { @@ -20,20 +17,17 @@ return { claude = { endpoint = 'https://api.anthropic.com', model = 'claude-sonnet-4-20250514', - timeout = 30000, -- Timeout in milliseconds + timeout = 30000, extra_request_body = { temperature = 0.75, max_tokens = 20480, }, }, }, - -- system_prompt as function ensures LLM always has latest MCP server state - -- This is evaluated for every message, even in existing chats system_prompt = function() local hub = require('mcphub').get_hub_instance() return hub and hub:get_active_servers_prompt() or '' end, - -- Using function prevents requiring mcphub before it's loaded custom_tools = function() return { require('mcphub.extensions.avante').mcp_tool(), @@ -43,30 +37,11 @@ return { dependencies = { 'nvim-lua/plenary.nvim', 'MunifTanjim/nui.nvim', - --- The below dependencies are optional, - 'echasnovski/mini.pick', -- for file_selector provider mini.pick - 'nvim-telescope/telescope.nvim', -- for file_selector provider telescope - 'stevearc/dressing.nvim', -- for input provider dressing - 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons - -- { - -- -- support for image pasting - -- 'HakonHarnes/img-clip.nvim', - -- event = 'VeryLazy', - -- 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, - -- }, - -- }, - -- }, + 'echasnovski/mini.pick', + 'nvim-telescope/telescope.nvim', + 'stevearc/dressing.nvim', + 'nvim-tree/nvim-web-devicons', { - -- Make sure to set this up properly if you have lazy=true 'MeanderingProgrammer/render-markdown.nvim', opts = { file_types = { 'markdown', 'Avante' },