feat: advanced avate

This commit is contained in:
hypercross 2025-03-30 16:40:50 +08:00
parent f433a750b6
commit 311210a46d
2 changed files with 62 additions and 0 deletions

View File

@ -2,6 +2,7 @@
"LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" },
"SchemaStore.nvim": { "branch": "main", "commit": "e659e0c6ca06727ed898aaaeea3850f528898684" }, "SchemaStore.nvim": { "branch": "main", "commit": "e659e0c6ca06727ed898aaaeea3850f528898684" },
"avante.nvim": { "branch": "main", "commit": "edf02a7d1fccb65f52d308594401d41134ff4d20" }, "avante.nvim": { "branch": "main", "commit": "edf02a7d1fccb65f52d308594401d41134ff4d20" },
"blink-cmp-avante": { "branch": "master", "commit": "e5a1be4c818520385f95fe2663c04e48f5f0c36a" },
"blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" }, "blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },

View File

@ -97,4 +97,65 @@ return {
}, },
}, },
}, },
{
"nvim-neo-tree/neo-tree.nvim",
config = function()
require("neo-tree").setup({
filesystem = {
commands = {
avante_add_files = function(state)
local node = state.tree:get_node()
local filepath = node:get_id()
local relative_path = require("avante.utils").relative_path(filepath)
local sidebar = require("avante").get()
local open = sidebar:is_open()
-- ensure avante sidebar is open
if not open then
require("avante.api").ask()
sidebar = require("avante").get()
end
sidebar.file_selector:add_selected_file(relative_path)
-- remove neo tree buffer
if not open then
sidebar.file_selector:remove_selected_file("neo-tree filesystem [1]")
end
end,
},
window = {
mappings = {
["oa"] = "avante_add_files",
},
},
},
})
end,
},
{
"saghen/blink.cmp",
dependencies = {
"Kaiser-Yang/blink-cmp-avante",
-- ... Other dependencies
},
opts = {
sources = {
-- Add 'avante' to the list
default = { "avante", "lsp", "path", "snippets", "buffer" },
providers = {
avante = {
module = "blink-cmp-avante",
name = "Avante",
opts = {
-- options for blink-cmp-avante
},
},
},
},
},
},
} }