From 89085df02e149c564bf472e40186bb6ada1a2d3b Mon Sep 17 00:00:00 2001 From: Gregory Danielson Date: Sun, 1 Jun 2025 11:24:58 -0500 Subject: [PATCH] docs(recipes): Add recipe for enabling supertab behavior in blink.cmp This recipe sets up blink.cmp's bindings such that will navigate down a list of completions, and will navigate up that list. Enter will submit the selected completion and drop the user into the completion's parameter(s) or directly after the inserted text, whichever applies to that completion. For reference, I had to dig for close to an hour to figure out how to do this. The following reddit thread is a collection of similar frustrations, as well as multiple outdated ways to achieve this: https://www.reddit.com/r/neovim/comments/1hfotru/nvimcmp_super_tab_in_blink/ An incomplete solution is here: https://github.com/LazyVim/LazyVim/discussions/250#discussioncomment-12461707 But the preset must be set to "enter", as noted here: https://github.com/Saghen/blink.cmp/discussions/576#discussioncomment-11599108 I plainly cannot find where this is documented within blink.cmp's docs. --- docs/configuration/recipes.md | 17 +++++++++++++++++ lua/recipes.lua | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/configuration/recipes.md b/docs/configuration/recipes.md index 80cceca794..5a00d6eeeb 100644 --- a/docs/configuration/recipes.md +++ b/docs/configuration/recipes.md @@ -25,6 +25,23 @@ override nvim-cmp and add cmp-emoji Use `` for completion and snippets (supertab). +### blink.cmp + +```lua +{ + "Saghen/blink.cmp", + opts = { + keymap = { + preset = "enter", + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, + }, + }, + } +``` + +### nvim-cmp + ```lua { "hrsh7th/nvim-cmp", diff --git a/lua/recipes.lua b/lua/recipes.lua index 771efff001..c95f6b356e 100644 --- a/lua/recipes.lua +++ b/lua/recipes.lua @@ -11,7 +11,7 @@ return { end, }, - -- ## Supertab + -- ## Supertab for nvim-cmp -- -- Use `` for completion and snippets (supertab). { @@ -56,6 +56,20 @@ return { end, }, + -- ## Supertab for blink.cmp + -- + -- Use `` for completion and snippets (supertab). + { + "Saghen/blink.cmp", + opts = { + keymap = { + preset = "enter", + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, + }, + }, + }, + -- ## Change surround mappings { "echasnovski/mini.surround",