# Avante.nvim — AI-Powered Code Editing in Neovim > A Neovim plugin that brings AI-assisted code suggestions, inline edits, and chat-driven refactoring directly into the editor using Claude, GPT, or local models. ## Install Save as a script file and run: # Avante.nvim — AI-Powered Code Editing in Neovim ## Quick Use ```lua -- In your lazy.nvim plugin spec: { "yetone/avante.nvim", build = "make", opts = { provider = "claude", }, } -- Then in Neovim: aa to open the Avante sidebar ``` ## Introduction Avante.nvim is a Neovim plugin that integrates large language models into the editing workflow. It provides a sidebar chat interface, inline code suggestions with diff previews, and the ability to apply AI-generated edits directly to your buffer with a single keystroke. ## What Avante.nvim Does - Opens a sidebar panel for conversing with an LLM about the current file or selection - Generates code edits and displays them as inline diffs before applying - Supports multiple AI providers including Claude, OpenAI, Azure, Gemini, and local models - Provides context-aware suggestions using the current buffer, selection, and project files - Integrates with Neovim's built-in LSP for code-aware completions and diagnostics ## Architecture Overview Avante.nvim is written in Lua with a Rust core module compiled via make for performance-critical parsing. The plugin hooks into Neovim's buffer events and uses tree-sitter for code structure awareness. API calls to LLM providers are made asynchronously, and responses are streamed token-by-token into the sidebar or diff view. Edit suggestions are parsed into hunks and applied through Neovim's buffer API. ## Self-Hosting & Configuration - Requires Neovim 0.10+ and a C compiler for the native module build step - Set your API key via environment variable (e.g., ANTHROPIC_API_KEY) or in the config - Configure the provider and model in the opts table passed to the plugin - Customize keybindings for sidebar toggle, apply edit, and accept/reject diff - Optionally point to a local model endpoint (Ollama, LM Studio) for offline use ## Key Features - Inline diff view lets you review and selectively apply AI-suggested changes - Multi-file context allows referencing other project files in conversations - Image paste support for vision-capable models to discuss UI screenshots - Conversation history persists across sessions per project - Extensible prompt templates for custom workflows like code review or documentation ## Comparison with Similar Tools - **Copilot.vim** — GitHub Copilot integration; autocomplete-focused, no sidebar chat - **Codeium.vim** — free AI autocomplete; faster suggestions but no interactive editing - **ChatGPT.nvim** — simple chat interface; lacks inline diff and edit application - **Cody (Neovim)** — Sourcegraph AI with codebase context; different context retrieval model - **Codecompanion.nvim** — modular AI plugin for Neovim; more configurable but requires more setup ## FAQ **Q: Which AI provider should I use?** A: Claude and GPT-4 produce the best results for complex edits. For privacy-sensitive work, configure a local model via Ollama. **Q: Does Avante send my entire codebase to the API?** A: No. It sends only the current buffer contents, selected text, and any files you explicitly reference in the conversation. **Q: Can I use Avante with lazy.nvim?** A: Yes. Avante is designed for lazy.nvim and includes a build step that compiles the Rust module on install. **Q: How do I apply only part of a suggested diff?** A: Use the hunk navigation keys to step through individual changes and accept or reject each one independently. ## Sources - https://github.com/yetone/avante.nvim - https://avante.nvim.wiki --- Source: https://tokrepo.com/en/workflows/asset-4d5a73dc Author: Script Depot