Efficient Aider setup with Gemini 2.5 models, vim bindings, and carefully tuned performance settings
Production-ready Aider configuration optimized for Gemini 2.5 models with cost-effective fallbacks and vim workflow integration.
This configuration prioritizes:
Ensure Aider is installed and API keys are configured:
```bash
aider --version
echo $GEMINI_API_KEY
echo $ANTHROPIC_API_KEY # if using Claude aliases
echo $OPENROUTER_API_KEY # if using OpenRouter aliases
```
Save this configuration as `.aider.conf.yml` in your project root or `~/.aider.conf.yml` for global use:
```yaml
model: g
weak-model: gf
alias:
- "c37:anthropic/claude-3-7-sonnet-20250219"
- "c37_or:openrouter/anthropic/claude-3.7-sonnet"
- "c40:anthropic/claude-sonnet-4-20250514"
- "g:gemini/gemini-2.5-pro"
- "gf:gemini/gemini-2.5-flash"
- "gl:gemini/gemini-2.5-flash-lite-preview-06-17"
- "gpt4o:openrouter/gpt-4o"
edit-format: diff-fenced
suggest-shell-commands: false
map-tokens: 0
auto-commits: false
code-theme: one-dark
vim: true
editor: nvim
```
| Setting | Value | Rationale |
|---------|-------|-----------|
| `model: g` | Gemini 2.5 Pro | Balanced cost/performance for main coding |
| `weak-model: gf` | Gemini 2.5 Flash | Fast, cheap for simple tasks |
| `edit-format: diff-fenced` | Fenced diffs | Required for Gemini models |
| `map-tokens: 0` | Disabled | Prevents unnecessary repo mapping costs |
| `auto-commits: false` | Manual commits | Full control over git history |
| `vim: true` | Vim bindings | Modal editing inside Aider |
| `editor: nvim` | Neovim | External editor for complex edits |
**Cost-effective workflow:**
```bash
aider --model gf
/model g
/model gl
```
**Claude fallback for specific tasks:**
```bash
/model c37
/model c40
```
**OpenRouter alternatives:**
```bash
/model c37_or
/model gpt4o
```
With `vim: true`, Aider supports modal editing:
1. **Start cheap**: Use `gf` (Flash) for initial exploration
2. **Upgrade selectively**: Switch to `g` (Pro) only when Flash struggles
3. **Disable repo map**: `map-tokens: 0` prevents expensive indexing
4. **Manual commits**: Review changes before committing
**If Gemini models fail:**
```bash
echo $GEMINI_API_KEY
aider --model c37_or
```
**If diff-fenced format causes issues:**
```bash
aider --edit-format diff
```
**If vim bindings conflict:**
```bash
aider --no-vim
```
```bash
aider --model gf
/add src/main.py
/add tests/test_main.py
> Extract the login logic into a separate function
/model g
> Refactor to use dependency injection pattern
/git status
/git diff
/git commit -m "refactor: extract login logic and add DI"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/gemini-optimized-aider-config/raw