Overview
blink.cmp is a performant alternative to nvim-cmp. Avante.nvim provides full compatibility with blink.cmp throughblink.compat, enabling you to use mentions, slash commands, and shortcuts with better performance.
Installation
Install blink.cmp and configure it with Avante sources:LazyVim Users
If you’re using LazyVim, extend the blink.cmp configuration:Manual Setup
For other setups, configure blink.cmp with custom providers:Avante Sources Explained
avante_commands
Provides slash command completions when you type/:
/help- Show help/init- Initialize project instructions/clear- Clear chat history/new- Start new chat/compact- Compact history/lines- Query specific lines/commit- Generate commit message
score_offset = 90 (above LSP)
avante_mentions
Provides mention completions when you type@:
@codebase- Enable project context@diagnostics- Include diagnostics@file- Add files to context@quickfix- Add quickfix files@buffers- Add open buffers
score_offset = 1000 (highest)
avante_shortcuts
Provides shortcut completions when you type#:
#refactor- Refactoring prompt#test- Test generation prompt#explain- Code explanation prompt- Custom shortcuts you define
score_offset = 1000 (highest)
avante_files
Provides file path completions in Avante context. Priority:score_offset = 100
Complete Configuration Example
Here’s a full example with both blink.cmp and Avante configured:Alternative: blink-cmp-avante
You can also use the dedicated Kaiser-Yang/blink-cmp-avante plugin:Selector Provider Configuration
When using blink.cmp, you must configure a non-native selector:- Telescope (Recommended)
- fzf-lua
- mini.pick
- snacks
nvim-telescope/telescope.nvimPriority Configuration
Adjustscore_offset to change completion priority:
Usage
Once configured, completions work automatically:Slash Commands
- Type
/in Avante chat - Completion menu shows available commands
- Select with arrow keys or
<C-n>/<C-p> - Press
<CR>to accept
Mentions
- Type
@in Avante chat - See mentions like
@codebase,@file - Select and accept
- For
@file, a file picker opens
Shortcuts
- Type
#in Avante chat - See shortcuts like
#refactor,#test - Select to expand the prompt
Troubleshooting
Completions not appearing
Completions not appearing
- Verify blink.cmp is installed and loaded
- Check that Avante sources are in
sources.default - Ensure
module = "blink.compat.source"is set - Look for errors in
:messages - Try
:BlingCmpDebugto check sources
Native selector error
Native selector error
Change selector provider:Install the corresponding dependency (telescope, fzf-lua, etc.)
Completions in wrong order
Completions in wrong order
Adjust
score_offset values to change priority:Performance issues
Performance issues
- blink.cmp should be faster than nvim-cmp
- If still slow, reduce number of active sources
- Check for conflicts with other completion plugins
blink.cmp vs nvim-cmp
| Feature | nvim-cmp | blink.cmp |
|---|---|---|
| Performance | Good | Excellent |
| Lua API | Stable | Evolving |
| Ecosystem | Large | Growing |
| Setup Complexity | Medium | Medium |
| Avante Support | Native | Via compat |
Migration from nvim-cmp
If migrating from nvim-cmp to blink.cmp:Related Documentation
Completion Sources
Learn about all completion sources
Slash Commands
Complete slash command reference
File Selector
Configure file picker providers