From 143fbadf8f6dc37d3c6c01c08c8b5baeea779db7 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Tue, 24 Dec 2024 15:38:46 +0800 Subject: [PATCH] feat(blink.cmp): enable cmdline auto-complete for blink.cmp --- lua/configs/saghen/blink-cmp/config.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/configs/saghen/blink-cmp/config.lua b/lua/configs/saghen/blink-cmp/config.lua index 17c860d5..4e301dc4 100644 --- a/lua/configs/saghen/blink-cmp/config.lua +++ b/lua/configs/saghen/blink-cmp/config.lua @@ -46,12 +46,19 @@ require("blink.cmp").setup({ end, }, completion = { + list = { + -- Use "auto_insert" for cmdline, otherwise use "preselect". + selection = function(ctx) + return ctx.mode == "cmdline" and "auto_insert" or "preselect" + end, + }, accept = { auto_brackets = { enabled = true } }, documentation = { auto_show = true }, }, sources = { - -- Disable cmdline completions - cmdline = {}, + min_keyword_length = function() + return 1 + end, }, signature = { enabled = true,