feat(ai): add avante.nvim for a better AI experience (#4440)

I switched over to https://github.com/yetone/avante.nvim and I think
this is the best experience in terms of UI and easiness to add patches
to your code.

I'm recommending it to everyone.

~~However, I couldn't make render-markdown to work on Avante. It seems
that my spec here is running before the one defined in
extras/lang/markdown.lua and getting overwritten even though I added
`optional = true`. I'll try to dig in deeper, but if someone has any
pointers, I'd appreciate it.~~

  - Fixes #4394

---------

Co-authored-by: PatMulligan <43773168+PatMulligan@users.noreply.github.com>
Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
George Guimarães
2025-10-20 05:47:17 -03:00
committed by GitHub
parent 5d186c009a
commit 2682ce0ab9

View File

@@ -0,0 +1,86 @@
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",
opts = {
provider = "copilot",
selection = {
hint_display = "none",
},
},
cmd = {
"AvanteAsk",
"AvanteBuild",
"AvanteChat",
"AvanteClear",
"AvanteEdit",
"AvanteFocus",
"AvanteHistory",
"AvanteModels",
"AvanteRefresh",
"AvanteShowRepoMap",
"AvanteStop",
"AvanteSwitchProvider",
"AvanteToggle",
},
keys = {
{ "n", "<leader>aa", "<cmd>AvanteAsk<CR>", desc = "Ask Avante" },
{ "n", "<leader>ac", "<cmd>AvanteChat<CR>", desc = "Chat with Avante" },
{ "n", "<leader>ae", "<cmd>AvanteEdit<CR>", desc = "Edit Avante" },
{ "n", "<leader>af", "<cmd>AvanteFocus<CR>", desc = "Focus Avante" },
{ "n", "<leader>ah", "<cmd>AvanteHistory<CR>", desc = "Avante History" },
{ "n", "<leader>am", "<cmd>AvanteModels<CR>", desc = "Select Avante Model" },
{ "n", "<leader>an", "<cmd>AvanteChatNew<CR>", desc = "New Avante Chat" },
{ "n", "<leader>ap", "<cmd>AvanteSwitchProvider<CR>", desc = "Switch Avante Provider" },
{ "n", "<leader>ar", "<cmd>AvanteRefresh<CR>", desc = "Refresh Avante" },
{ "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,
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" } },
},
},
},
}