feat(blink): make it usable

This commit is contained in:
Oliver Ladner 2025-05-12 10:37:28 +02:00
commit 9fef3df7ef

View file

@ -3,7 +3,7 @@ return {
lazy = true,
event = { "BufReadPre", "BufNewFile" },
-- optional: provides snippets for the snippet source
dependencies = { "rafamadriz/friendly-snippets" },
dependencies = { "rafamadriz/friendly-snippets", "Kaiser-Yang/blink-cmp-git" },
-- use a release tag to download pre-built binaries
version = "1.*",
@ -33,8 +33,10 @@ return {
["<C-j>"] = { "select_next", "fallback" },
["<Tab>"] = { "accept", "fallback" },
["<C-c>"] = { "cancel", "fallback" },
["<C-n>"] = { "scroll_documentation_down" },
["<C-p>"] = { "scroll_documentation_up" },
["<C-s>"] = { "show" },
},
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
@ -42,14 +44,49 @@ return {
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = true } },
completion = {
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
documentation = { auto_show = true },
-- Use text instead of icons in autocompletion menu
menu = {
draw = {
columns = {
{ "label", "label_description", gap = 1 },
{ "kind_icon", "kind", gap = 1, "source_name" },
},
},
},
},
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { "lsp", "path", "snippets", "buffer" },
default = { "lsp", "path", "snippets" },
providers = {
git = {
module = "blink-cmp-git",
name = "Git",
-- only enable this source when filetype is gitcommit, markdown, or 'octo'
enabled = function()
return vim.tbl_contains({ "octo", "gitcommit", "markdown" }, vim.bo.filetype)
end,
opts = {
-- options for the blink-cmp-git
},
},
},
per_filetype = {
lua = { "lsp", "buffer", "path", "snippets" },
markdown = { "lsp", "path", "snippets" }, -- do not add 'buffer' here, it's slow AF
text = { "buffer", "path" },
ps1 = { "lsp", "buffer", "path", "snippets" },
},
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`