diff --git a/lua/taken/plugins/blink.lua b/lua/taken/plugins/blink.lua index 032ce45..23b7f0d 100644 --- a/lua/taken/plugins/blink.lua +++ b/lua/taken/plugins/blink.lua @@ -1,7 +1,10 @@ return { "saghen/blink.cmp", - dependencies = "rafamadriz/friendly-snippets", - enabled = false, + dependencies = { + "rafamadriz/friendly-snippets", + "L3MON4D3/LuaSnip", + }, + -- enabled = false, version = "*", config = function() require("blink-cmp").setup({ @@ -10,31 +13,52 @@ return { nerd_font_variant = "mono", }, keymap = { - preset = "enter", + preset = "default", [""] = {}, [""] = {}, + [""] = { "show", "show_documentation", "hide_documentation" }, + [""] = { "select_and_accept" }, + + [""] = { "select_prev", "fallback" }, + [""] = { "select_next", "fallback" }, + }, + completion = { + menu = { + border = "rounded", + }, + documentation = { + auto_show = true, + window = { + border = "single", + }, + }, + }, + snippets = { + preset = "luasnip", + expand = function(snippet) + require("luasnip").lsp_expand(snippet) + end, + active = function(filter) + if filter and filter.direction then + return require("luasnip").jumpable(filter.direction) + end + return require("luasnip").in_snippet() + end, + jump = function(direction) + require("luasnip").jump(direction) + end, }, sources = { - default = { "lsp", "luasnip", "snippets", "buffer", "path" }, + default = { "lsp", "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, @@ -43,14 +67,14 @@ return { }, buffer = { name = "Buffer", + enabled = true, module = "blink.cmp.sources.buffer", - min_keyword_length = 2, + score_offset = 70, }, path = { name = "Path", module = "blink.cmp.sources.path", score_offset = 3, - fallbacks = { "snippets", "luasnip", "buffer" }, opts = { trailing_slash = false, label_trailing_slash = true,