local MP = ... return { { "blink.pairs", dep_of = { "blink.cmp" }, auto_enable = true, after = function() require("blink.pairs").setup({ highlights = { enabled = false, }, }) end, }, { "luasnip", auto_enable = true, dep_of = { "blink.cmp" }, after = function(_) local luasnip = require("luasnip") require("luasnip.loaders.from_vscode").lazy_load() luasnip.config.setup({}) local ls = require("luasnip") local s = ls.snippet local t = ls.text_node local i = ls.insert_node local extras = require("luasnip.extras") local rep = extras.rep local fmta = require("luasnip.extras.fmt").fmta local c = ls.choice_node local f = ls.function_node local d = ls.dynamic_node local sn = ls.snippet_node vim.keymap.set({ "i", "s" }, "", function() if ls.choice_active() then ls.change_choice(1) end end) end, }, { "colorful-menu.nvim", auto_enable = true, on_plugin = { "blink.cmp" }, }, { "blink.cmp", auto_enable = true, event = { "InsertEnter", "CmdlineEnter" }, after = function(_) require("blink.cmp").setup({ keymap = { preset = "default" }, cmdline = { enabled = true, completion = { menu = { auto_show = true, }, }, sources = function() local type = vim.fn.getcmdtype() -- Search forward and backward if type == "/" or type == "?" then return { "buffer" } end -- Commands if type == ":" or type == "@" then return { "cmdline" } end return {} end, }, term = { enabled = false, }, fuzzy = { sorts = { "exact", "score", "sort_text", }, }, appearance = { nerd_font_variant = "mono", }, signature = { enabled = true, window = { show_documentation = true, }, }, completion = { menu = { draw = { columns = { { "label", "label_description", gap = 1 }, { "srckind" }, }, treesitter = { "lsp" }, components = { srckind = { ellipsis = false, width = { fill = true }, text = function(ctx) return ctx.kind end, highlight = function(ctx) return ctx.kind_hl end, }, label = { text = function(ctx) return require("colorful-menu").blink_components_text(ctx) end, highlight = function(ctx) return require("colorful-menu").blink_components_highlight(ctx) end, }, }, }, }, documentation = { auto_show = true, }, }, ---@type blink.cmp.SnippetsConfig snippets = { preset = "luasnip", active = function(filter) local snippet = require("luasnip") local blink = require("blink.cmp") if snippet.in_snippet() and not blink.is_visible() then return true else if not snippet.in_snippet() and vim.fn.mode() == "n" then snippet.unlink_current() vim.snippet.stop() end return false end end, }, sources = { default = { "lsp", "path", "snippets", "buffer", "omni" }, providers = { path = { score_offset = 50, }, lsp = { score_offset = 40, }, snippets = { score_offset = 40, }, }, }, }) end, }, }