Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2826812
Update nvim setup
emmanuel-adu Jun 26, 2025
c3dba1c
Fix merge conflicts
emmanuel-adu Jun 26, 2025
a1361b5
Address merge conflicts
emmanuel-adu Jun 26, 2025
d553a43
chore: node path setup, typescript-tools, copilot lint fix
emmanuel-adu Dec 2, 2025
12281ab
feat: modernize nvim config - add testing, claude ai, improve perform…
emmanuel-adu Dec 2, 2025
c1957b7
fix: switch from jest to vitest in neotest configuration
emmanuel-adu Dec 2, 2025
617b669
feat: add full interactive Jupyter notebook support via molten.nvim
emmanuel-adu Dec 2, 2025
da3599d
docs: clarify Ghostty terminal support for molten.nvim
emmanuel-adu Dec 2, 2025
33f6ae5
feat: add comprehensive Vim learning plugins for beginners
emmanuel-adu Dec 2, 2025
7fa9af0
fix: migrate avante.nvim to new provider configuration format
emmanuel-adu Dec 2, 2025
eeeb7a3
fix: move avante.nvim max_tokens and temperature to extra_request_body
emmanuel-adu Dec 2, 2025
3d98bfc
feat: add OpenAI support to avante.nvim (multi-provider setup)
emmanuel-adu Dec 2, 2025
f5e505e
feat: add centralized keymap reference and update README for custom N…
emmanuel-adu Mar 10, 2026
04e6add
feat: replace floaterm with toggleterm, add bufferline and mini.pairs…
emmanuel-adu May 29, 2026
60131f2
merge: sync with upstream kickstart-modular.nvim
emmanuel-adu May 29, 2026
8264ad4
feat: merge personal options into kickstart config and add git status…
emmanuel-adu Jun 2, 2026
5c04d89
remove hardtime and modify tokyo night
emmanuel-adu Jul 29, 2026
8965658
replace lazygit.lua with git.lua and added render markdown
emmanuel-adu Jul 29, 2026
bab1f1f
disable useless plugins and update keymaps
emmanuel-adu Jul 29, 2026
b638459
update keymaps
emmanuel-adu Jul 29, 2026
ee324f3
merge: sync with upstream kickstart-modular.nvim
emmanuel-adu Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ nvim
spell/

# In your personal fork, you likely want to comment this, since it's recommended to track
# nvim-pack-lock.json in version control - see :help vim.pack-lockfile
# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile
# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
# merge conflicts.
nvim-pack-lock.json
lazy-lock.json

.nvimlog
.DS_Store
273 changes: 273 additions & 0 deletions AVANTE_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
# Avante.nvim Multi-Provider Setup

Avante.nvim now supports **both Claude (Anthropic) and OpenAI**! Switch between them seamlessly.

---

## 🔑 API Key Setup

### Option 1: Scoped Keys (Recommended)

Set provider-specific keys that only Avante uses:

```bash
# Add to ~/.zshrc or ~/.bashrc

# Claude (Anthropic)
export AVANTE_ANTHROPIC_API_KEY="your-claude-api-key"

# OpenAI (GPT-4)
export AVANTE_OPENAI_API_KEY="your-openai-api-key"
```

### Option 2: Global Keys (Legacy)

Use keys shared across all applications:

```bash
# Claude
export ANTHROPIC_API_KEY="your-claude-api-key"

# OpenAI
export OPENAI_API_KEY="your-openai-api-key"
```

**After adding keys:**
```bash
source ~/.zshrc # or ~/.bashrc
```

---

## 🔄 Switching Between Providers

### Method 1: Keybinding (Easiest)
```vim
<leader>as " Switch provider (Claude ↔ OpenAI)
```

### Method 2: Command
```vim
:AvanteSwitchProvider
```

### Method 3: Change Default
Edit `lua/custom/plugins/avante.lua`:
```lua
provider = 'claude', -- Change to 'openai'
```

---

## 🎯 Current Configuration

### Default Provider
**Claude (Sonnet 4)** - Best for:
- Code generation
- Deep reasoning
- Long context understanding

### Alternative Provider
**OpenAI (GPT-4o)** - Best for:
- Fast responses
- General tasks
- When you want variety

---

## 📋 Getting API Keys

### Claude (Anthropic)
1. Go to: https://console.anthropic.com/settings/keys
2. Create new key
3. Copy and set as `AVANTE_ANTHROPIC_API_KEY`

**Models available:**
- `claude-sonnet-4-20250514` (default - balanced)
- `claude-opus-4-20250514` (most capable)
- `claude-3-5-sonnet-20241022` (fast)

### OpenAI
1. Go to: https://platform.openai.com/api-keys
2. Create new key
3. Copy and set as `AVANTE_OPENAI_API_KEY`

**Models available:**
- `gpt-4o` (default - multimodal)
- `gpt-4-turbo` (faster)
- `gpt-4` (most capable)

---

## 🚀 Usage

### Basic Workflow

1. **Open Avante sidebar:**
```vim
<leader>aa
```

2. **Ask a question:**
- Type your prompt
- Press `<CR>` to submit

3. **Edit code with AI:**
- Visual select code: `V` + movement
- Press `<leader>ae` (edit selection)
- Describe changes
- Apply diff: `a` or `A`

4. **Switch providers if needed:**
```vim
<leader>as " Claude ↔ OpenAI
```

---

## 💡 When to Use Which Provider

### Use Claude for:
- ✅ Complex code generation
- ✅ Architecture decisions
- ✅ Deep debugging
- ✅ Long context (100k+ tokens)
- ✅ Precise code modifications

### Use OpenAI for:
- ✅ Quick questions
- ✅ General programming help
- ✅ Faster responses
- ✅ When Claude is busy/rate-limited
- ✅ Image understanding (gpt-4o)

---

## 🔧 Advanced Configuration

### Change Models

Edit `lua/custom/plugins/avante.lua`:

```lua
providers = {
claude = {
model = 'claude-opus-4-20250514', -- More powerful
},
openai = {
model = 'gpt-4-turbo', -- Faster
},
}
```

### Adjust Temperature

```lua
extra_request_body = {
temperature = 0.7, -- 0 = deterministic, 1 = creative
}
```

### Change Max Tokens

```lua
extra_request_body = {
max_tokens = 8000, -- Longer responses
}
```

---

## 🆘 Troubleshooting

### "API key not found"
**Solution:** Set environment variable and restart terminal
```bash
export AVANTE_ANTHROPIC_API_KEY="your-key"
source ~/.zshrc
```

### "Rate limit exceeded"
**Solution:** Switch providers
```vim
<leader>as " Switch to alternative provider
```

### "Invalid API key"
**Solution:** Check key is correct
```bash
echo $AVANTE_ANTHROPIC_API_KEY # Should show your key
echo $AVANTE_OPENAI_API_KEY
```

### Provider not switching
**Solution:** Restart Neovim
```bash
:qa!
nvim
```

---

## 📊 Cost Comparison

### Claude Pricing
- Sonnet 4: $3/million input, $15/million output tokens
- Opus 4: $15/million input, $75/million output tokens
- Very cost-effective for code tasks

### OpenAI Pricing
- GPT-4o: $2.50/million input, $10/million output tokens
- GPT-4 Turbo: $10/million input, $30/million output tokens
- Good for quick tasks

**Tip:** Use Claude as default, OpenAI as backup for rate limits.

---

## 🎊 All Keybindings

```vim
<leader>aa " Toggle Avante sidebar
<leader>ar " Refresh Avante
<leader>ae " Edit selection with AI (visual mode)
<leader>ac " Clear Avante
<leader>as " Switch provider (Claude ↔ OpenAI)
```

**In Avante window:**
```vim
<CR> " Submit prompt
<C-s> " Submit prompt (insert mode)
a " Apply suggestion to cursor
A " Apply all suggestions
<Tab> " Switch windows
```

---

## 🌟 Pro Tips

1. **Use both providers:**
- Claude for complex tasks
- OpenAI for quick questions

2. **Set scoped keys:**
- Keeps Avante keys separate from other tools
- Easier to manage

3. **Monitor usage:**
- Check API dashboards regularly
- Set spending limits

4. **Switch on rate limits:**
- Hit Claude limit? `<leader>as` to OpenAI
- Hit OpenAI limit? `<leader>as` to Claude

5. **Experiment with models:**
- Try different models for different tasks
- Adjust temperature for creativity

---

Enjoy your multi-provider AI coding experience! 🚀🤖
Loading