Overview
Avante.nvim provides powerful diff management capabilities inspired by git-conflict.nvim. When the AI suggests code changes, you can review and selectively apply them using intuitive keybindings.Diff Conflict Keybindings
When viewing AI-suggested changes, you’ll see conflicts between your current code (“ours”) and the AI’s suggestions (“theirs”). Use these keybindings to resolve conflicts:Primary Actions
Navigation
These keybindings are inspired by vim-fugitive’s merge conflict resolution patterns, making them familiar to vim users.
Customizing Diff Keybindings
You can customize all diff-related keybindings in your configuration:Custom Keybinding Example
Auto-Jump Feature
Avante can automatically jump to the first conflict when applying diffs:boolean
default:"true"
When enabled, automatically jumps to the first conflict after a diff is applied
Timeout Configuration
To avoid conflicts with vim’s operator-pending mode, Avante can override thetimeoutlen setting while hovering over a diff:
number
default:"500"
Override the
timeoutlen setting while hovering over a diff to avoid entering operator-pending mode. Set to -1 to disable.This helps prevent accidentally triggering vim’s operator-pending mode when using diff mappings that start with
c.Diff Highlights
Customize how diffs are highlighted:Available Highlight Groups
List Opener
Configure how the conflict list is opened:Focus After Apply
Control which diff to focus after applying changes:string
default:"ours"
Which diff to focus after applying. Options:
"ours"- Focus on your current code"theirs"- Focus on AI’s suggestion
Minimize Diff
Remove unchanged lines when applying code blocks:Workflow Example
1
Request AI Changes
Ask the AI to modify your code using
:AvanteAsk or :AvanteEdit.2
Review Conflicts
The AI’s suggestions appear as conflicts. Review the differences between “ours” (current) and “theirs” (AI).
3
Navigate Conflicts
Use
]x and [x to jump between conflicts.4
Resolve Conflicts
For each conflict, choose:
co- Keep your versionct- Accept AI’s versioncb- Keep bothcc- Use version under cursor
5
Apply All (Optional)
Use
ca to accept all AI suggestions at once, or A in the sidebar to apply all changes.Auto-Apply Mode
For faster workflows, enable auto-apply to skip conflict resolution:Tips and Tricks
Quick Accept
Use
ca to quickly accept all AI suggestions if you trust the changes.Selective Review
Navigate with
]x/[x to review each conflict individually before deciding.Hybrid Approach
Use
cb to keep both versions when you want to merge ideas manually.Cursor Control
Position your cursor on the preferred version and use
cc for quick resolution.Troubleshooting
Keybindings not working
Keybindings not working
- Ensure
behaviour.auto_set_keymaps = truein your config - Check for keybinding conflicts with other plugins
- Verify you’re in the diff buffer when pressing keys
Cannot see conflicts
Cannot see conflicts
- Ensure
behaviour.auto_set_highlight_group = true - Check your colorscheme supports diff highlights
- Try customizing
highlights.diffsettings
Autojump not working
Autojump not working
Verify
diff.autojump = true in your configuration.Related Documentation
Keybindings
View all available keybindings
Usage Guide
Learn basic Avante workflows
Highlights
Customize visual appearance