From fc49f0e376f65b51dd4f09c94646675674543153 Mon Sep 17 00:00:00 2001 From: James Tien Date: Tue, 23 Dec 2025 11:53:26 +0800 Subject: [PATCH 1/2] Add a `vim-plug` section in `installation.md` to show how to install blink.cmp by `vim-plug`. --- doc/installation.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/installation.md b/doc/installation.md index 86935f1e7..b45b0d6a0 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -180,3 +180,31 @@ MiniDeps.add({ }, }) ``` + +### vim-plug + +In `init.vim`, install `blink.cmp` and config fetching the pre-built binary as the post-installation action: + +``` +Plug 'saghen/blink.cmp', {'tag': 'v1.*'} +``` + +Next, manually call the setup function either from a standalone lua configuration file or a lua heredoc section in vimscript: + +```lua +require('blink.cmp').setup({ + keymap = { preset = 'default' }, + appearance = { + nerd_font_variant = 'mono' + }, + completion = { + documentation = { auto_show = false } + }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + fuzzy = { + implementation = "prefer_rust_with_warning" + } +}) +``` From 423c21eeb2ab87854746d73b9d39c1445ea030cc Mon Sep 17 00:00:00 2001 From: James Tien Date: Wed, 24 Dec 2025 10:55:21 +0800 Subject: [PATCH 2/2] Address the review feedback https://github.com/saghen/blink.cmp/pull/2321#issuecomment-3686822227. Closes #2216 * Link to the relevant issue #2216 from this particular commit message. * Clarify the configuration is the same one from the lazy.vim section. * Reuse the same explanation to the post-installation actions * Incorporate both the VimScript version and the Lua version so users can just copy & paste them easier. --- doc/installation.md | 85 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 18 deletions(-) diff --git a/doc/installation.md b/doc/installation.md index b45b0d6a0..e285e2b67 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -181,30 +181,79 @@ MiniDeps.add({ }) ``` -### vim-plug +## vim-plug -In `init.vim`, install `blink.cmp` and config fetching the pre-built binary as the post-installation action: +This section shows how to perform the equivalent default setup as demonstrated in the [lazy.nvim](#lazy.nvim) section using `vim-plug`. +To install, add `blink.cmp` and its optional dependencies, then manually call `setup()` for further configuration: -``` -Plug 'saghen/blink.cmp', {'tag': 'v1.*'} +VimScript: + +```vim +call plug#begin() +" use a release tag to download pre-built binaries. +" To build from source, use { 'do': 'cargo build --release' } instead +" If you use nix, use { 'do': 'nix run .#build-plugin' } +Plug 'saghen/blink.cmp', { 'tag': 'v1.*' } + +" optional: provides snippets for the snippet source +Plug 'rafamadriz/friendly-snippets' +call plug#end() + +lua << EOF +require('blink.cmp').setup({ + keymap = { preset = 'default' }, + appearance = { + nerd_font_variant = 'mono' + }, + completion = { + documentation = { auto_show = false } + }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + fuzzy = { + implementation = "prefer_rust_with_warning" + } +}) +EOF ``` -Next, manually call the setup function either from a standalone lua configuration file or a lua heredoc section in vimscript: +Lua: ```lua +local Plug = vim.fn['plug#'] + +-- Plugin installation +vim.call('plug#begin') + +-- use a release tag to download pre-built binaries. +-- To build from source, use { ['do'] = 'cargo build --release' } instead +-- If you use nix, use { ['do'] = 'nix run .#build-plugin' } +Plug('saghen/blink.cmp', { ['tag'] = 'v1.*' }) + +-- optional: provides snippets for the snippet source +Plug('rafamadriz/friendly-snippets') + +vim.call('plug#end') + +-- Plugin configuration require('blink.cmp').setup({ - keymap = { preset = 'default' }, - appearance = { - nerd_font_variant = 'mono' - }, - completion = { - documentation = { auto_show = false } - }, - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, - }, - fuzzy = { - implementation = "prefer_rust_with_warning" - } + keymap = { preset = 'default' }, + + appearance = { + nerd_font_variant = 'mono' + }, + + completion = { + documentation = { auto_show = false } + }, + + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + + fuzzy = { + implementation = "prefer_rust_with_warning" + } }) ```