avante-corp /avante.nvim
Use your Neovim like using Cursor AI IDE!
★ 18,195⑂ 855👁 70⑃ 2,012● 1,188▤ 46
+3
日增长
18,195
stars
855
forks
70
watchers
2,012
prs
1,188
issues
46
releases
README
avante.nvim
avante.nvim 是一个 Neovim 插件,旨在模拟 Cursor AI IDE 的行为。它为用户提供 AI 驱动的代码建议,并能够轻松地将这些建议直接应用到源文件中。
View in English
[!NOTE]
🥰 该项目正在快速迭代中,许多令人兴奋的功能将陆续添加。敬请期待!
赞助 ❤️
如果您喜欢这个项目,请考虑在 Patreon 上支持我,因为这有助于我继续维护和改进它:
赞助我
功能
- AI 驱动的代码辅助:与 AI 互动,询问有关当前代码文件的问题,并接收智能建议以进行改进或修改。
- 一键应用:通过单个命令快速将 AI 的建议更改应用到源代码中,简化编辑过程并节省时间。
安装
如果您希望从源代码构建二进制文件,则需要 cargo。否则,将使用 curl 和 tar 从 GitHub 获取预构建的二进制文件。
lazy.nvim (推荐)
lua
{
"yetone/avante.nvim",
-- 如果您想从源代码构建,请执行 make BUILD_FROM_SOURCE=true
-- ⚠️ 一定要加上这一行配置!!!!!
build = vim.fn.has("win32") ~= 0
and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make",
event = "VeryLazy",
version = false, -- 永远不要将此值设置为 ""!永远不要!
---@module 'avante'
---@type avante.Config
opts = {
-- 在此处添加任何选项
-- 例如
provider = "claude",
providers = {
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-sonnet-5-5",
timeout = 30000, -- Timeout in milliseconds
extra_request_body = {
max_tokens = 20480,
},
},
moonshot = {
endpoint = "https://api.moonshot.ai/v1",
model = "kimi-k2-0711-preview",
timeout = 30000, -- 超时时间(毫秒)
extra_request_body = {
temperature = 0.75,
max_tokens = 32768,
},
},
},
},
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- 以下依赖项是可选的,
"echasnovski/mini.pick", -- 用于文件选择器提供者 mini.pick
"nvim-telescope/telescope.nvim", -- 用于文件选择器提供者 telescope
"hrsh7th/nvim-cmp", -- avante 命令和提及的自动完成
"ibhagwan/fzf-lua", -- 用于文件选择器提供者 fzf
"nvim-tree/nvim-web-devicons", -- 或 echasnovski/mini.icons
"zbirenbaum/copilot.lua", -- 用于 providers='copilot'
{
-- 支持图像粘贴
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- 推荐设置
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- Windows 用户必需
use_absolute_path = true,
},
},
},
{
-- 如果您有 lazy=true,请确保正确设置
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}
vim-plug
vim
" 依赖项
Plug 'nvim-lua/plenary.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'MeanderingProgrammer/render-markdown.nvim'
" 可选依赖项
Plug 'hrsh7th/nvim-cmp'
Plug 'nvim-tree/nvim-web-devicons' "或 Plug 'echasnovski/mini.icons'
Plug 'HakonHarnes/img-clip.nvim'
Plug 'zbirenbaum/copilot.lua'
" Yay,如果您想从源代码构建,请传递 source=true
Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make' }
autocmd! User avante.nvim lua
mini.deps
lua
local add, later, now = MiniDeps.add, MiniDeps.later, MiniDeps.now
add({
source = 'yetone/avante.nvim',
monitor = 'main',
depends = {
'nvim-lua/plTop issues
#2127bug: Using ollama stuck on generating37 comments · 2025-06-03#3038breaking changes on main branch13 comments · 2026-05-01#3155Can't authenticate Claude "rate_limit_error, Rate Limited. Please try again later."10 comments · 2026-06-24#3076bug: filesystem access isn't limited to cwd10 comments · 2026-05-17#1200bug: Unsupported operating system: OpenBSD8 comments · 2025-02-06#2952feature: dont send system_prompt to use server default one (true for at least llama.cpp)6 comments · 2026-02-08#3235bug: System prompts and tool definitions have drifted out of sync.5 comments · 2026-09-15#3159bug: Tool Calling Hangs without Error or Debug5 comments · 2026-06-28
Discussions
#3172Proposal: Add Aurelo as a first-class model provider0 comments · 2026-07-14#3152Avante.nvim: Can't authenticate Claude "rate_limit_error, Rate Limited. Please try again later."0 comments · 2026-06-23#3139Provider stuck always to default provider1 comments · 2026-06-13#3018Trouble setting up for claude subscription0 comments · 2026-04-13#3016Why does the AI get stuck in an infinite loop and ignores all my prompts1 comments · 2026-04-11#3014`str_replace` fails to work correctly1 comments · 2026-04-07#3012Bedrock provider where the url for auth is different than the model url?0 comments · 2026-04-05#2988Edit selected blocks in parallel0 comments · 2026-03-11
Latest release
v0.5.0 v0.5.0 2026-10-310.5.0 (2026-10-31) This release starts 2 refactoring: - move more of the backend code to rust libraries: this release moves ACP support from homemade lua code to a rust library relying on the official ACP SDK. The goal is to make the backend more robust/featureful while keeping the ability to hack advanced stuff with lua. There is no point in redeveloping the whole backend from scratch, with all the bugs it entails. This frees maintainer time to focus on the actual neovim integration. 0.6 will move the classical LLM API backend to rust as well. This means the rust libraries are likely to e