2025-03-27 08:18:20 +00:00
|
|
|
return {
|
2025-03-27 10:47:46 +00:00
|
|
|
'saghen/blink.cmp',
|
2025-03-27 12:48:32 +00:00
|
|
|
dependencies = { 'rafamadriz/friendly-snippets' },
|
2025-03-28 16:13:27 +00:00
|
|
|
version = '1.*',
|
2025-03-27 08:18:20 +00:00
|
|
|
|
2025-03-27 10:47:46 +00:00
|
|
|
---@module 'blink.cmp'
|
|
|
|
|
---@type blink.cmp.Config
|
|
|
|
|
opts = {
|
2025-09-11 22:09:14 +01:00
|
|
|
sources = {
|
|
|
|
|
default = { 'i18n', 'snippets', 'lsp', 'path', 'buffer' },
|
|
|
|
|
providers = {
|
|
|
|
|
lsp = { fallbacks = {} },
|
|
|
|
|
i18n = {
|
|
|
|
|
name = 'i18n',
|
|
|
|
|
module = 'i18n.integration.blink_source',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-03-27 10:47:46 +00:00
|
|
|
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 },
|
|
|
|
|
},
|
2025-07-23 21:07:35 +01:00
|
|
|
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',
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-03-27 10:47:46 +00:00
|
|
|
},
|
|
|
|
|
opts_extend = { "sources.default" },
|
|
|
|
|
}
|