fixed blink.lua

This commit is contained in:
liph
2026-02-05 16:37:16 +01:00
parent 001c74dfa7
commit 5a78d47050
2 changed files with 17 additions and 27 deletions

View File

@@ -25,7 +25,7 @@
"gruvbox-mat": { "branch": "master", "commit": "790afe9dd085aa04eccd1da3626c5fa05c620e53" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"luvit-meta": { "branch": "main", "commit": "0ea4ff636c5bb559ffa78108561d0976f4de9682" },

View File

@@ -1,48 +1,43 @@
-- blink.lua: Temporarily highlights cursor position after movement to improve visibility.
-- ~/.config/nvim/lua/plugins/blink.lua
return {
"saghen/blink.cmp",
version = "v1.*", -- stay on stable branch
build = "cargo build --release", -- compile matcher locally (or download pre-built)
lazy = false, -- must load before first LSP attach
"saghen/blink.cmp", -- ✅ CORRECT: Use the shorthand plugin name for lazy.nvim.
version = "v1.*",
build = "cargo build --release", -- Builds the optional high-performance Rust fuzzy matcher[citation:7].
lazy = false, -- Must load early for LSP capabilities.
dependencies = {
"L3MON4D3/LuaSnip",
"rafamadriz/friendly-snippets",
},
opts = {
-- silence "incomplete build" message and prefer pre-built binary
fuzzy = { implementation = "prefer_rust" },
fuzzy = { implementation = "prefer_rust" }, -- Silences missing binary warning, uses pre-built if available.
---------------------------------------------------------------------------
-- completion sources
-- SOURCES - CRITICAL FIX HERE
---------------------------------------------------------------------------
sources = {
min_keyword_length = 2, -- <-- moved here (global default)
default = { "nvim_lsp", "luasnip", "buffer", "path", "cmp_tabnine" },
min_keyword_length = 2,
default = { "lsp", "snippets", "buffer", "path", "cmp_tabnine" }, -- ✅ Use lowercase provider IDs.
providers = {
nvim_lsp = { name = "LSP", module = "blink.cmp.sources.lsp" },
luasnip = { name = "Snippets", module = "blink.cmp.sources.luasnip" },
lsp = { name = "LSP", module = "blink.cmp.sources.lsp" }, -- ✅ "lsp"
snippets = { name = "Snippets", module = "blink.cmp.sources.snippets" }, -- ✅ "snippets" for luasnip
buffer = { name = "Buffer", module = "blink.cmp.sources.buffer" },
path = { name = "Path", module = "blink.cmp.sources.path" },
cmp_tabnine = {
name = "TabNine",
module = "blink.compat.source",
score_offset = 3,
module = "blink.compat.source", -- ✅ Requires the optional `blink.compat` plugin.
},
},
per_filetype = {
lua = { default = { "lazydev", "nvim_lsp", "luasnip", "buffer", "path" } },
lua = { default = { "lazydev", "lsp", "snippets", "buffer", "path" } },
},
},
---------------------------------------------------------------------------
-- completion behaviour
-- COMPLETION BEHAVIOR
---------------------------------------------------------------------------
completion = {
accept = { auto_brackets = { enabled = true } },
trigger = {
show_on_trigger_character = true, -- min_keyword_length removed
},
trigger = { show_on_trigger_character = true },
list = {
selection = {
preselect = function(ctx)
@@ -55,12 +50,7 @@ return {
auto_show_delay_ms = 100,
},
},
signature = {
enabled = true,
window = { border = "rounded" },
},
signature = { enabled = true, window = { border = "rounded" } },
cmdline = { enabled = false },
},