-- https://github.com/saghen/blink.cmp --- @module "lazy" --- @type LazySpec return { "saghen/blink.cmp", dependencies = { "rafamadriz/friendly-snippets" }, event = "InsertEnter", -- use a release tag to download pre-built binaries version = "1.*", --- @module "blink-cmp" --- @type blink.cmp.Config opts = { keymap = { preset = "default", [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "scroll_documentation_up" }, [""] = { "scroll_documentation_down" }, [""] = { "accept", "fallback" }, [""] = { function(cmp) if cmp.is_visible() then cmp.cancel() if cmp.get_selected_item_idx() ~= nil or cmp.snippet_active() then return true end elseif cmp.snippet_active() then vim.snippet.stop() end end, "fallback", }, [""] = { "select_next", "snippet_forward", "fallback" }, [""] = { "select_prev", "snippet_backward", "fallback" }, [""] = { "select_prev", "fallback" }, [""] = { "select_next", "fallback" }, [""] = { "select_prev", "fallback_to_mappings" }, [""] = { "select_next", "fallback_to_mappings" }, [""] = { "show_signature", "hide_signature", "fallback" }, }, appearance = { nerd_font_variant = "normal", }, completion = { ghost_text = { enabled = true, }, list = { selection = { preselect = false, }, }, documentation = { auto_show = true, auto_show_delay_ms = 0, }, menu = { auto_show = true, draw = { columns = { { "label", "label_description", gap = 1 }, { "kind", "source_name", gap = 1 }, }, components = { source_name = { text = function(ctx) if ctx.source_id ~= "snippets" then return "[" .. ctx.source_name .. "]" end end, }, }, }, }, }, signature = { enabled = true, trigger = { show_on_accept = true, show_on_insert = true, }, }, sources = { default = { "lazydev", "lsp", "path", "snippets", "buffer", }, providers = { lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", score_offset = 100, }, }, }, cmdline = { enabled = false, }, fuzzy = { implementation = "prefer_rust_with_warning" }, }, opts_extend = { "sources.default" }, }