avante-corp/avante.nvim
Use your Neovim like using Cursor AI IDE!
avante.nvim – AI‑assisted coding inside Neovim
What it is
- A Neovim plugin that brings the experience of the Cursor AI IDE directly into the editor. It lets you chat with an LLM, ask for code improvements, and apply the suggested changes with a single command.
How it works
- The plugin talks to one (or more) LLM providers such as Anthropic’s Claude, OpenAI, Gemini, Moonshot, etc. The provider, model, endpoint and request parameters are configurable in the
setup()call. - When you open a chat window, Avante sends the current buffer (or a selected region) together with any project‑specific instructions you place in an
avante.mdfile at the repository root. The model returns a code block, which Avante can:- Show as markdown inside Neovim, and
- Apply to the file automatically (diff‑based, with options to minimise unchanged lines).
- A special Zen Mode lets you run Avante as a stand‑alone CLI (
avante) while still using the full power of Neovim under the hood.
Key features
- AI‑powered code assistance – ask questions about the file you’re editing and receive concrete suggestions.
- One‑click apply – accept a suggestion and have Avante rewrite the buffer for you.
- Project‑specific instruction file (
avante.md) – define the AI’s persona, mission, stack, coding standards, etc., so the model can tailor its advice to your codebase. - Multiple providers & dual‑boost mode – configure several back‑ends; an experimental mode can query two providers and combine their outputs.
- Auto‑suggestions (optional) – the plugin can request suggestions in the background as you type.
- ACP (AI‑Code‑Planner) support – tools can automatically edit files, follow locations, and approve permissions.
- Prompt logging – saves every request/response to disk for replay or debugging.
- Extensible UI – works with any markdown renderer that recognises the
Avantefiletype; optional UI helpers (snacks.nvim, nui.nvim, render‑markdown.nvim, etc.) are supported.
Installation
- Recommended via lazy.nvim (or any other plugin manager). A
makestep builds a small Rust binary (or downloads a pre‑built one). Example lazy.nvim snippet from the README:{ "yetone/avante.nvim", build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" or "make", event = "VeryLazy", version = false, opts = { instructions_file = "avante.md", provider = "claude", providers = { claude = { endpoint = "https://api.anthropic.com", model = "claude-sonnet-4-20250514", timeout = 30000, extra_request_body = { temperature = 0.75, max_tokens = 20480 }, }, }, }, dependencies = { "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim", ... }, } - Other managers (Pack, rocks.nvim, vim‑plug, mini.deps, Home Manager, Nixvim) are also documented.
Basic usage
require('avante').setup{ … }– optionally pass your configuration.- Open a chat with
:Avante(or the keymap defined inmappings.suggestion). - Type a question or request (e.g., “Refactor this function to use async/await”). Avante streams the model’s response.
- Accept a suggestion with
<M‑l>(default) or dismiss with<C‑]>. - The change is applied as a diff; you can navigate diffs with
]x/[x. - To enable Zen Mode, install the helper script from
./contrib/avanteand runavantefrom the terminal – you’ll get a CLI that still uses Neovim for rendering.
Customization points
- Provider configuration – choose any supported model, set temperature, max tokens, timeout, etc.
- Behaviour flags – toggle auto‑suggestions, auto‑apply diffs, token counting, automatic file addition, etc.
- Key mappings – all major actions (accept, next/prev suggestion, diff navigation, submit, cancel) are remappable.
- Prompt logger – enable/disable, change log directory, bind keys to browse previous/next logs.
- Dual‑boost – experimental mode to combine two providers’ outputs.
Ecosystem & dependencies
- Core Lua code (
plenary.nvim,nui.nvim). - Optional UI helpers:
render-markdown.nvim,nvim-cmp,img-clip.nvim,copilot.lua,snacks.nvim,mini.pick,telescope.nvim,fzf-lua. - A small Rust binary (built with Cargo) handles the heavy lifting of communicating with the LLM APIs.
Maturity
- Actively maintained (CI badges for Lua and Rust tests, rapid iteration note in the README).
- Requires Neovim 0.11+ (or 0.12+ for full feature set).
- Some features are marked experimental (auto‑suggestions, dual‑boost, ACP auto‑approval).
Who might benefit
- Developers who spend most of their time in Neovim and want inline AI assistance without leaving the editor.
- Teams that need project‑specific coding guidelines to be enforced by the LLM (via
avante.md). - Users who like the Cursor AI IDE experience but prefer a fully open‑source, self‑hosted workflow.
All information above is taken directly from the repository’s README.
Written about in
Related
- Project
- Project
- Project
- Project
- Project