Skip to main content

Overview

blink.cmp is a performant alternative to nvim-cmp. Avante.nvim provides full compatibility with blink.cmp through blink.compat, enabling you to use mentions, slash commands, and shortcuts with better performance.
When using blink.cmp with Avante, choose a selector other than native as it currently has known issues.

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
Priority: 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
Priority: 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
Priority: 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:
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:

Priority Configuration

Adjust score_offset to change completion priority:
Higher values = higher priority in completion menu.

Usage

Once configured, completions work automatically:

Slash Commands

  1. Type / in Avante chat
  2. Completion menu shows available commands
  3. Select with arrow keys or <C-n>/<C-p>
  4. Press <CR> to accept

Mentions

  1. Type @ in Avante chat
  2. See mentions like @codebase, @file
  3. Select and accept
  4. For @file, a file picker opens

Shortcuts

  1. Type # in Avante chat
  2. See shortcuts like #refactor, #test
  3. Select to expand the prompt

Troubleshooting

  1. Verify blink.cmp is installed and loaded
  2. Check that Avante sources are in sources.default
  3. Ensure module = "blink.compat.source" is set
  4. Look for errors in :messages
  5. Try :BlingCmpDebug to check sources
Change selector provider:
Install the corresponding dependency (telescope, fzf-lua, etc.)
Adjust score_offset values to change priority:
  1. blink.cmp should be faster than nvim-cmp
  2. If still slow, reduce number of active sources
  3. Check for conflicts with other completion plugins
Recommendation: Use blink.cmp if you prioritize performance; use nvim-cmp for a more mature ecosystem.

Migration from nvim-cmp

If migrating from nvim-cmp to blink.cmp:
1

Install blink.cmp

Add blink.cmp to your plugin manager with the configuration above.
2

Remove nvim-cmp

Remove or disable nvim-cmp from your config.
3

Configure Avante Sources

Use blink.compat.source module for Avante completion sources.
4

Test Completions

Verify slash commands, mentions, and shortcuts work in Avante chat.
5

Adjust Priorities

Fine-tune score_offset values based on your preferences.

Completion Sources

Learn about all completion sources

Slash Commands

Complete slash command reference

File Selector

Configure file picker providers