3.7 KiB
3.7 KiB
Avante Setup Guide
✅ Installation Complete
Avante has been installed and configured to use your existing Copilot Premium subscription (OpenAI API).
🔑 Configuration
Your Avante setup is configured to:
- Provider: Copilot (OpenAI - using your existing subscription)
- Model: gpt-4o
- UI: Native Neovim sidebar on the right
- Dependencies: Uses existing telescope, fzf-lua, snacks.nvim
⌨️ Keybindings
All Avante commands use the <leader>a prefix:
| Keybinding | Action |
|---|---|
<leader>aa |
Ask Avante about code (selection or cursor) |
<leader>ae |
Edit with Avante |
<leader>at |
Toggle Avante sidebar |
<leader>ar |
Refactor code |
<leader>ax |
EXecute slash command (e.g., /code, /debug) |
<leader>ad |
Document code |
<leader>af |
Fix code issues |
🚀 First Use
- Open Neovim - Avante will be automatically loaded
- First time setup - If you haven't set your OpenAI API key, Avante will prompt you
- Test it:
- Select some code in visual mode:
v+ select code - Press
<leader>aato ask Avante about it - Or press
<leader>atto toggle the sidebar
- Select some code in visual mode:
🔐 API Key Setup
Your existing OPENAI_API_KEY environment variable is used. If not set:
- Get your API key from https://platform.openai.com/api-keys
- Add to your shell profile (
~/.zshrcor~/.bash_profile):export OPENAI_API_KEY="your-api-key-here" - Restart your terminal or run:
source ~/.zshrc
📝 Project Instructions (Optional)
Create an avante.md file in your project root to give Avante project-specific context:
# Project Instructions
## Your Role
You are an expert developer specializing in [your tech stack].
## Your Mission
Help build and maintain [project description].
## Tech Stack
- Frontend: [your frontend tech]
- Backend: [your backend tech]
- Testing: [your testing framework]
## Code Standards
- Use [your coding style]
- Follow [your project's patterns]
- Prioritize [performance/readability/etc]
🎯 Workflow Tips
Quick Ask About Code
1. Place cursor on code
2. Press <leader>aa
3. Type your question
4. Press Enter
Visual Selection
1. Select code: v + arrow keys
2. Press <leader>aa or <leader>ar
3. Ask your question
Toggle Sidebar
Press <leader>at to toggle the sidebar on/off
Use <Tab> to switch between Avante and your code
🔄 Comparing with OpenCode
You now have both tools:
| Tool | Best For |
|---|---|
OpenCode (<leader>o*) |
Agent-orchestrated complex tasks, multi-step coding |
Avante (<leader>a*) |
Quick focused edits, refactoring, inline suggestions |
❓ Troubleshooting
Avante not working?
- Run
:checkhealth avantein Neovim - Verify
OPENAI_API_KEYis set:echo $OPENAI_API_KEY - Restart Neovim
API errors?
- Check your API key is valid at https://platform.openai.com/api-keys
- Verify you have API credits/quota available
- Check OpenAI status: https://status.openai.com
Sidebar not appearing?
- Try
:lua require('avante.api').toggle()manually - Check dependencies are installed:
:checkhealth avante
📚 More Resources
- Avante Docs: https://github.com/yetone/avante.nvim
- Copilot Premium: Verify you're on a paid plan at https://github.com/account/billing/overview
- OpenAI Docs: https://platform.openai.com/docs
Next Steps
- ✅ Plugin installed - you're here!
- 🚀 Try Avante on a real coding task
- 📊 Compare with OpenCode to find your workflow
- 🎯 Customize keybindings if needed (edit
/lua/custom/plugins/avante.lua) - 💡 Create
avante.mdfor better context
Happy coding! 🎉