https://github.com/yetone/avante.nvim Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} yetone / avante.nvim Public * Notifications You must be signed in to change notification settings * Fork 58 * Star 2.2k Use your Neovim like using Cursor AI IDE! License Apache-2.0 license 2.2k stars 58 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 9 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights yetone/avante.nvim This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 195 Commits .github/workflows .github/workflows lua lua .editorconfig .editorconfig .gitignore .gitignore .luacheckrc .luacheckrc .pre-commit-config.yaml .pre-commit-config.yaml Build-LuaTiktoken.ps1 Build-LuaTiktoken.ps1 LICENSE LICENSE Makefile Makefile README.md README.md View all files Repository files navigation * README * Apache-2.0 license avante.nvim avante.nvim is a Neovim plugin designed to emulate the behaviour of the Cursor AI IDE. It provides users with AI-driven code suggestions and the ability to apply these recommendations directly to their source files with minimal effort. Note This project is undergoing rapid iterations, and many exciting features will be added successively. Stay tuned! avante-2.mp4 avante-3.mp4 Features * AI-Powered Code Assistance: Interact with AI to ask questions about your current code file and receive intelligent suggestions for improvement or modification. * One-Click Application: Quickly apply the AI's suggested changes to your source code with a single command, streamlining the editing process and saving time. Installation Install avante.nvim using lazy.nvim: { "yetone/avante.nvim", event = "VeryLazy", build = "make", -- This is Optional, only if you want to use tiktoken_core to calculate tokens count opts = { -- add any opts here }, dependencies = { "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons "stevearc/dressing.nvim", "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim", --- The below is optional, make sure to setup it properly if you have lazy=true { 'MeanderingProgrammer/render-markdown.nvim', opts = { file_types = { "markdown", "Avante" }, }, ft = { "markdown", "Avante" }, }, }, } For Windows users, change the build command to the following: { "yetone/avante.nvim", event = "VeryLazy", build = "powershell -ExecutionPolicy Bypass -File Build-LuaTiktoken.ps1", -- This is Optional, only if you want to use tiktoken_core to calculate tokens count -- rest of the config } Important avante.nvim is currently only compatible with Neovim 0.10.0 or later. Please ensure that your Neovim version meets these requirements before proceeding. Important If your neovim doesn't use LuaJIT, then change build to make lua51. By default running make will install luajit. Avante.nvim will now requires cargo to build tiktoken_core from source. Note Recommended Neovim options: -- views can only be fully collapsed with the global statusline vim.opt.laststatus = 3 -- Default splitting will cause your main splits to jump when opening an edgebar. -- To prevent this, set `splitkeep` to either `screen` or `topline`. vim.opt.splitkeep = "screen" Note render-markdown.nvim is an optional dependency that is used to render the markdown content of the chat history. Make sure to also include Avante as a filetype to its setup: { "MeanderingProgrammer/render-markdown.nvim", opts = { file_types = { "markdown", "Avante" }, }, ft = { "markdown", "Avante" }, } Default setup configuration: See config.lua#L9 for the full config { ---@alias Provider "openai" | "claude" | "azure" | "copilot" | [string] provider = "claude", claude = { endpoint = "https://api.anthropic.com", model = "claude-3-5-sonnet-20240620", temperature = 0, max_tokens = 4096, }, mappings = { ask = "aa", edit = "ae", refresh = "ar", --- @class AvanteConflictMappings diff = { ours = "co", theirs = "ct", none = "c0", both = "cb", next = "]x", prev = "[x", }, jump = { next = "]]", prev = "[[", }, submit = { normal = "", insert = "", }, toggle = { debug = "ad", hint = "ah", }, }, hints = { enabled = true }, windows = { wrap = true, -- similar to vim.o.wrap width = 30, -- default % based on available width sidebar_header = { align = "center", -- left, center, right for title rounded = true, }, }, highlights = { ---@type AvanteConflictHighlights diff = { current = "DiffText", incoming = "DiffAdd", }, }, --- @class AvanteConflictUserConfig diff = { debug = false, autojump = true, ---@type string | fun(): any list_opener = "copen", }, } Usage Given its early stage, avante.nvim currently supports the following basic functionalities: Important Avante will only support OpenAI (and its variants including copilot and azure), and Claude out-of-the-box due to its high code quality generation. For all OpenAI-compatible providers, see wiki for more details. Important For most consistency between neovim session, it is recommended to set the environment variables in your shell file. By default, Avante will prompt you at startup to input the API key for the provider you have selected. For Claude: export ANTHROPIC_API_KEY=your-api-key For OpenAI: export OPENAI_API_KEY=your-api-key For Azure OpenAI: export AZURE_OPENAI_API_KEY=your-api-key 1. Open a code file in Neovim. 2. Use the :AvanteAsk command to query the AI about the code. 3. Review the AI's suggestions. 4. Apply the recommended changes directly to your code with a simple command or key binding. Note: The plugin is still under active development, and both its functionality and interface are subject to significant changes. Expect some rough edges and instability as the project evolves. Key Bindings The following key bindings are available for use with avante.nvim: * Leaderaa -- show sidebar * Leaderar -- show sidebar * co -- choose ours * ct -- choose theirs * cb -- choose both * c0 -- choose none * ]x -- move to previous conflict * [x -- move to next conflict Highlight Groups Highlight Group Description AvanteTitle Title AvanteReversedTitle Used for rounded border AvanteSubtitle Selected code title AvanteReversedSubtitle Used for rounded border AvanteThirdTitle Prompt title AvanteReversedThirdTitle Used for rounded border TODOs * [*] Chat with current file * [*] Apply diff patch * [*] Chat with the selected block * [*] Slash commands * [ ] Edit the selected block * [ ] Smart Tab (Cursor Flow) * [ ] Chat with project * [ ] Chat with selected files Roadmap * Enhanced AI Interactions: Improve the depth of AI analysis and recommendations for more complex coding scenarios. * LSP + Tree-sitter + LLM Integration: Integrate with LSP and Tree-sitter and LLM to provide more accurate and powerful code suggestions and analysis. Contributing Contributions to avante.nvim are welcome! If you're interested in helping out, please feel free to submit pull requests or open issues. Before contributing, ensure that your code has been thoroughly tested. See wiki for more recipes and tricks. License avante.nvim is licensed under the Apache License. For more details, please refer to the LICENSE file. About Use your Neovim like using Cursor AI IDE! Resources Readme License Apache-2.0 license Activity Stars 2.2k stars Watchers 22 watching Forks 58 forks Report repository Releases No releases published Packages 0 No packages published Contributors 19 * * * * * * * * * * * * * * + 5 contributors Languages * Lua 98.8% * Other 1.2% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.