Trying out blink cmp

This commit is contained in:
2024-12-22 16:01:13 +01:00
parent 631de5358a
commit f1e340fa89
3 changed files with 73 additions and 3 deletions

View File

@@ -0,0 +1,67 @@
return {
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
version = "*",
config = function()
require("blink-cmp").setup({
appearance = {
use_nvim_cmp_as_default = true,
nerd_font_variant = "mono",
},
keymap = {
preset = "enter",
["<C-space>"] = {},
["<C-e>"] = {},
["<C-c>"] = { "show", "show_documentation", "hide_documentation" },
},
sources = {
default = { "lsp", "luasnip", "snippets", "buffer", "path" },
providers = {
lsp = {
name = "lsp",
enabled = true,
module = "blink.cmp.sources.lsp",
-- kind = "LSP",
-- fallbacks = { "snippets", "luasnip", "buffer" },
score_offset = 90,
},
luasnip = {
name = "luasnip",
enabled = true,
module = "blink.cmp.sources.luasnip",
min_keyword_length = 2,
-- fallbacks = { "snippets" },
score_offset = 85,
},
snippets = {
name = "snippets",
enabled = true,
module = "blink.cmp.sources.snippets",
score_offset = 80,
},
buffer = {
name = "Buffer",
module = "blink.cmp.sources.buffer",
min_keyword_length = 2,
},
path = {
name = "Path",
module = "blink.cmp.sources.path",
score_offset = 3,
fallbacks = { "snippets", "luasnip", "buffer" },
opts = {
trailing_slash = false,
label_trailing_slash = true,
get_cwd = function(context)
return vim.fn.expand(("#%d:p:h"):format(context.bufnr))
end,
show_hidden_files_by_default = true,
},
},
},
},
})
end,
opts_extend = { "sources.default" },
}