How do I set up blink.cmp as a faster, Rust-powered completion engine in Neovim?
Answer
saghen/blink.cmp
Explanation
blink.cmp is a completion plugin for Neovim with its core fuzzy-matching logic written in Rust, making it significantly faster than pure-Lua alternatives like nvim-cmp — especially on large projects. It supports LSP, buffer, path, and snippet sources out of the box with native Neovim snippet support.
How it works
Install with lazy.nvim:
{
'saghen/blink.cmp',
event = 'InsertEnter',
build = 'cargo build --release',
opts = {
keymap = { preset = 'default' },
appearance = { use_nvim_cmp_as_default = false },
sources = { default = { 'lsp', 'path', 'snippets', 'buffer' } },
},
}
Default keymaps (preset default):
<C-space>— open completion menu<CR>— confirm selection<Tab>/<S-Tab>— select next/previous item<C-b>/<C-f>— scroll documentation window<C-e>— dismiss the menu
Example
Once installed, blink.cmp activates automatically in insert mode and shows completions with documentation previews. The Rust-compiled fuzzy matcher handles typos and transpositions (e.g., typing prnt still matches print).
Tips
- blink.cmp natively reads
vim.lsp.protocol.make_client_capabilities()— no extra config needed for LSP - Use
sources.providersto add third-party sources (e.g.,blink-cmp-ripgrep,blink-cmp-git) - The
buildstep requires Rust; useversion = '*'withbuild = falseto download a prebuilt binary instead - Set
opts.completion.documentation.auto_show = trueto show documentation side-by-side by default