Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 6, 2026·3 min de lectura

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.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 29/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Avante.nvim
Comando de staging seguro
npx -y tokrepo@latest install 4d5a73dc-7937-11f1-9bc6-00163e2b0d79 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

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

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados