nvim-config11/lua/plugins/blink.lua
2025-09-11 22:09:14 +01:00

53 lines
1.7 KiB
Lua

return {
'saghen/blink.cmp',
dependencies = { 'rafamadriz/friendly-snippets' },
version = '1.*',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
sources = {
default = { 'i18n', 'snippets', 'lsp', 'path', 'buffer' },
providers = {
lsp = { fallbacks = {} },
i18n = {
name = 'i18n',
module = 'i18n.integration.blink_source',
},
},
},
keymap = { preset = 'default' },
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = 'mono'
},
signature = { enabled = true },
completion = {
documentation = { auto_show = true, auto_show_delay_ms = 500 },
},
fuzzy = {
sorts = {
function(a, b)
local function get_client_name(item)
return item.client_id and vim.lsp.get_client_by_id(item.client_id).name or ""
end
local ca = get_client_name(a)
local cb = get_client_name(b)
local a_is_tailwind = ca == "tailwindcss"
local b_is_tailwind = cb == "tailwindcss"
-- Tailwind always wins over everything else
if a_is_tailwind and not b_is_tailwind then return true end
if b_is_tailwind and not a_is_tailwind then return false end
-- Fall back to default order
end,
'score',
'sort_text',
},
},
},
opts_extend = { "sources.default" },
}