local function build_blink(params) vim.notify('Building blink.cmp', vim.log.levels.INFO) local obj = vim.system({ 'cargo', 'build', '--release' }, { cwd = params.path }):wait() if obj.code == 0 then vim.notify('Building blink.cmp done', vim.log.levels.INFO) else vim.notify('Building blink.cmp failed', vim.log.levels.ERROR) end end MiniDeps.add({ source = 'https://github.com/saghen/blink.cmp', hooks = { post_install = build_blink, post_checkout = build_blink, }, }) require('blink.cmp').setup({ keymap = { preset = 'none', [''] = { 'accept', 'fallback' }, -- accept the snippet [''] = { 'show', 'show_documentation', 'hide_documentation' }, -- toggle auto-cmp manually [''] = { 'show_signature', 'hide_signature', 'fallback' }, -- toggle signature [''] = { 'select_next', 'fallback' }, -- next item [''] = { 'select_prev', 'fallback' }, -- previous item [''] = { 'scroll_documentation_down', 'fallback' }, -- forwards into the docs [''] = { 'scroll_documentation_up', 'fallback' }, -- backwards into the docs [''] = { 'cancel', 'fallback' }, -- keybind for cancelling completion }, snippets = { preset = 'luasnip' }, sources = { default = { 'lsp', 'path', 'snippets' }, }, completion = { menu = { auto_show = true, -- whether to automatically show the window when new completion items are available border = 'rounded', draw = { columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { 'kind' } }, treesitter = { 'lsp', 'snippets' }, }, }, documentation = { auto_show = true, -- whether documentation is automatically shown when selecting a completion item auto_show_delay_ms = 250, treesitter_highlighting = true, window = { border = "rounded" }, }, list = { selection = { preselect = true, auto_insert = true } }, trigger = { show_on_insert_on_trigger_character = true, show_on_accept_on_trigger_character = true, show_in_snippet = false, }, ghost_text = { enabled = true, show_with_selection = false, -- whether the ghost text is shown when an item is selected show_without_selection = true, -- whether the ghost text is shown when no item is selected show_with_menu = true, -- show ghost text when the menu is open show_without_menu = true, -- show ghost text when the menu is closed } }, fuzzy = { use_proximity = true, frecency = { enabled = true, }, prebuilt_binaries = { download = true, -- we are building from source } } })