3.9 KiB
3.9 KiB
🚀 Avante Quick Start
✅ You're All Set!
Avante has been successfully installed and configured for your Neovim setup.
What You Get
- Native Neovim Integration: No more switching to terminal
- Copilot Premium Powered: Uses your existing OpenAI API key
- Instant Access: Press
<leader>atto toggle the sidebar - Full Context: Works with your selected code, open buffers, and diagnostics
🎯 Try It Now (5 seconds)
- Open Neovim:
nvim - Open a code file
- Press:
<leader>at(toggle Avante sidebar) - Select some code with
vkey - Press:
<leader>aa(ask Avante) - Type your question and press Enter!
📋 Main Commands
Basic Workflow:
<leader>aa = Ask about selected code
<leader>ae = Edit/apply Avante suggestions
<leader>at = Toggle sidebar (on/off)
Advanced Tasks:
<leader>ar = Refactor code
<leader>ad = Add documentation
<leader>af = Fix issues/bugs
<leader>ax = Use slash commands (e.g., /debug, /analyze)
💡 Common Use Cases
Quick Question
1. Select function: v + select lines
2. Press <leader>aa
3. Ask: "What does this do?"
4. Read response in sidebar
Refactor Code
1. Place cursor on code
2. Press <leader>ar
3. Avante suggests improvements
4. Press 'a' to apply or review changes
Get Documentation
1. Select function
2. Press <leader>ad
3. Avante generates comments
4. Review and apply with 'a' key
Use Your Project Context
- Create
avante.mdin your project root - Avante will automatically use it for context
- Example: Tell it your tech stack, coding standards, etc.
🔑 Important: Set Your API Key
Before first use, make sure your OpenAI API key is set:
# Check if it's set:
echo $OPENAI_API_KEY
# If empty, add to ~/.zshrc or ~/.bash_profile:
export OPENAI_API_KEY="sk-..."
# Then restart terminal or:
source ~/.zshrc
🎮 Sidebar Navigation
Once <leader>at opens the sidebar:
| Key | Action |
|---|---|
<Tab> |
Switch between Avante and code |
<S-Tab> |
Switch back |
a |
Apply suggestion |
A |
Apply all suggestions |
| Arrow keys | Navigate responses |
i |
Enter insert mode to edit prompt |
🐛 Something Not Working?
-
Sidebar won't appear?
:checkhealth avanteCheck for red X marks and fix any issues
-
API errors?
- Verify key:
echo $OPENAI_API_KEYshould showsk-... - Check balance: https://platform.openai.com/account/billing/overview
- Restart Neovim after setting the key
- Verify key:
-
Need to change model?
- Edit:
/Users/stuartstephens/.config/nvim/lua/custom/plugins/avante.lua - Find line with
model = 'gpt-4o' - Change to
'gpt-4o-mini'for cheaper option
- Edit:
🆚 Compare with OpenCode
You now have TWO AI tools:
OpenCode (<leader>o*):
- Agent-based orchestration
- Best for: Complex, multi-step tasks
- Terminal UI in a split
- Access to MCP tools
Avante (<leader>a*):
- Direct LLM access
- Best for: Quick edits, refactoring
- Integrated sidebar
- Fast and focused
Use whichever feels right for each task!
📊 Monitor Your Costs
Both tools use OpenAI API, so costs add up:
- Check usage: https://platform.openai.com/account/billing/usage
- Set spending limit: https://platform.openai.com/account/billing/limits
🎓 Learn More
- Full guide: Read
AVANTE_SETUP.mdin your nvim config directory - Avante docs: https://github.com/yetone/avante.nvim
- OpenAI models: https://platform.openai.com/docs/models
✨ Tips & Tricks
- With selections: Visual mode (
v) + select +<leader>aa= instant context - Multi-file: Avante can see your whole open buffer context
- Diagnostics: Avante can see LSP errors - use it to fix them
- Project instructions: Create
avante.mdwith your standards - Keyboard only: Everything works without mouse (vim-native)
You're ready to go! 🎉
Try it now: Open Neovim and press <leader>at
Questions? Check AVANTE_SETUP.md for troubleshooting.