AI Coding Assistants
GentlemanNvim integrates multiple AI coding assistants, providing flexible workflows for different use cases. The configuration includes 5 AI tools, with OpenCode currently enabled as the primary assistant.Available AI Assistants
OpenCode
Currently Active - Primary AI assistant
GitHub Copilot
Enabled - Inline completions
Copilot Chat
Disabled - Chat interface (available)
Avante
Disabled - Cursor-like experience
CodeCompanion
Disabled - Agentic AI assistant
You can enable/disable AI assistants in
lua/plugins/disabled.lua. Only one chat-based AI should be active at a time to avoid keybinding conflicts.OpenCode (Primary)
Overview
OpenCode provides a clean AI chat interface integrated with Snacks picker:Key Features
Keybindings
| Keymap | Mode | Action | Context |
|---|---|---|---|
<leader>aa | n | Toggle OpenCode | Open/close chat |
<leader>as | n, x | Select & submit | Auto-submit with context |
<leader>ai | n, x | Ask (blank) | Empty prompt |
<leader>aI | n, x | Ask with @this: | Include current context |
<leader>ab | n, x | Ask about buffer | Query about @file |
<leader>ap | n, x | Prompt with @this | Custom prompt |
Built-in Prompts
OpenCode Prompt Commands
OpenCode Prompt Commands
| Keymap | Prompt | Use Case |
|---|---|---|
<leader>ape | explain | Explain how code works |
<leader>apf | fix | Fix bugs and issues |
<leader>apd | diagnose | Diagnose problems |
<leader>apr | review | Code review |
<leader>apt | test | Generate unit tests |
<leader>apo | optimize | Optimize performance |
Workflow Examples
Explain Function
- Position cursor on function
- Press
<leader>aI(ask with context) - Type: “Explain this function”
- AI receives function context automatically
Fix Bug
- Select problematic code (visual mode)
- Press
<leader>apf(fix prompt) - AI analyzes and suggests fixes
GitHub Copilot
Overview
Inline AI completions as you type:Disabled File Types
Default Keybindings
Inherited from LazyVim Copilot extra:| Keymap | Mode | Action |
|---|---|---|
<Tab> | i | Accept suggestion |
<M-]> | i | Next suggestion |
<M-[> | i | Previous suggestion |
<M-\> | i | Dismiss suggestion |
Setup Requirements
Copilot Chat (Available)
Overview
Conversational AI interface with custom system prompt:Custom System Prompt
The configuration includes a detailed Spanish-language system prompt:View System Prompt Details
View System Prompt Details
Personality:
- Frontend architect specialized in Angular and React
- Expert in Clean Architecture and Hexagonal Architecture
- Professional but approachable tone (Argentine Spanish)
- Focus on practical, actionable advice
- Frontend development (Angular, React, TypeScript)
- State management (Redux, Signals, custom solutions)
- Software architecture patterns
- Testing and best practices
- Modular design and atomic patterns
- Developer productivity tools
- Technical but accessible
- Uses practical analogies
- Provides clear examples
- Concise and direct
Predefined Prompts
All Copilot Chat Prompts
All Copilot Chat Prompts
Chat Keybindings
Copilot Chat Mappings (When Enabled)
Copilot Chat Mappings (When Enabled)
In Chat Window:
| Keymap | Mode | Action |
|---|---|---|
<Tab> | i | Complete |
q | n | Close |
<C-c> | i | Close |
<C-l> | n, i | Reset chat |
<CR> | n | Submit prompt |
<C-s> | i | Submit prompt |
<C-y> | n, i | Accept diff |
gd | n | Show diff |
gy | n | Yank diff |
gh | n | Show help |
Enable Copilot Chat
To enable:Avante (Available)
Overview
Cursor-like AI assistant with inline editing and file selection:Key Features
Cursor Planning
Enable cursor planning mode for multi-step edits
File Selection
Select multiple files for context
Inline Edits
AI suggests changes directly in your code
Diff View
Preview changes before accepting
Advanced Configuration
Avante includes complex resize handling to prevent UI issues:Resize Fix Implementation
Resize Fix Implementation
The configuration includes:
- VimResized handler - Manages terminal resize events
- Duplicate window cleanup - Prevents multiple Ask/Select panels
- Cursor management - Temporarily moves cursor during resize
- Redraw forcing - Ensures clean UI updates
Enable Avante
CodeCompanion (Available)
Overview
Full-featured agentic AI with tool support:Tool Support
CodeCompanion includes agentic tools:Available Tool Groups
Available Tool Groups
full_stack_dev:
cmd_runner- Execute shell commandseditor- Edit buffer contentsfiles- File system operations
- Same tools as full_stack_dev
- Custom system prompt for frontend architecture
- Requires approval for destructive operations
Multiple Model Support
GPT-4o
copilot_4o adapter
GPT-4.1
copilot_41 adapter
Gemini 2.5 Pro
copilot_gemini_25_pro
Slash Commands
Custom slash commands for enhanced context:/git_files in chat to include all tracked files as context.
Keybindings (When Enabled)
CodeCompanion Keymaps
CodeCompanion Keymaps
| Keymap | Mode | Action |
|---|---|---|
<leader>ac | n, v | Toggle chat |
<leader>an | n, v | New chat |
<leader>aa | n, v | Actions menu |
ga | v | Add to chat |
<leader>ae | v | Explain |
<CR>(normal) - Send<C-s>(insert) - Send<C-c>- Closega- Accept changegr- Reject change
Enable CodeCompanion
Blink.cmp Integration
All AI assistants integrate with the Blink completion engine:@mentionscompletion in AI chat- File path completion
- Command completion
Choosing the Right Assistant
Use Case Comparison
Use Case Comparison
| Use Case | Recommended Tool | Reason |
|---|---|---|
| Inline completions | GitHub Copilot | Fast, context-aware suggestions |
| Quick questions | OpenCode | Lightweight, built-in prompts |
| Complex refactoring | Avante | Inline editing with preview |
| Multi-file changes | CodeCompanion | Agentic tools, file operations |
| Code review | Copilot Chat | Dedicated review prompt |
| Learning/explanations | OpenCode/Copilot Chat | Conversational interface |
Configuration Tips
Switching AI Assistants
Authentication
All AI assistants use GitHub Copilot authentication:Avante, CodeCompanion, and Copilot Chat all use the same Copilot authentication. You only need to authenticate once.
Performance Considerations
Troubleshooting
AI Not Responding
Keybinding Conflicts
Next Steps
Keymaps
Learn all AI assistant keybindings
Plugins
Explore all installed plugins