avante-corp /avante.nvim

Use your Neovim like using Cursor AI IDE!

★ 18,195⑂ 855👁 70⑃ 2,012● 1,188▤ 46
LuaApache-2.0Created 2024-08-14
下载:v0.5.0v0.5.0 ↓0.5.02026-10-31
+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/pl

Top issues

Discussions

Latest release

v0.5.0 v0.5.0 2026-10-31
0.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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON