1 -- Performant, batteries-included completion plugin for Neovim.
2 -- https://github.com/Saghen/blink.cmp
7 require("blink-cmp").setup({
8 -- Enables keymaps, completions and signature help when true (doesn't apply to cmdline or term)
10 -- If the function returns 'force', the default conditions for disabling the plugin will be ignored
11 -- Default conditions: (vim.bo.buftype ~= 'prompt' and vim.b.completion ~= false)
12 -- Note that the default conditions are ignored when `vim.b.completion` is explicitly set to `true`
14 -- Exceptions: vim.bo.filetype == 'dap-repl'
15 --enabled = function()
16 -- return not vim.tbl_contains({ "lua", "markdown" }, vim.bo.filetype)
20 -- cmdline = { enabled = false },
23 -- 'prefix' will fuzzy match on the text before the cursor
24 -- 'full' will fuzzy match on the text before _and_ after the cursor
25 -- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full'
26 keyword = { range = "prefix" },
28 -- Disable auto brackets
29 -- NOTE: some LSPs may add auto brackets themselves anyway
30 accept = { auto_brackets = { enabled = false } },
37 -- or set via a function
40 -- preselect = function(ctx)
41 -- return vim.bo.filetype ~= "markdown"
49 -- nvim-cmp style menu
52 -- { "label", "label_description", gap = 1 },
53 -- { "kind_icon", "kind" },
58 -- Show documentation when selecting a completion item
59 documentation = { auto_show = true, auto_show_delay_ms = 2000 },
61 -- Whether to display a preview of the selected item on the current line
62 ghost_text = { enabled = false },
65 -- set to 'none' to disable the 'default' preset
68 ["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
69 ["<C-e>"] = { "hide", "fallback" },
70 ["<CR>"] = { "accept", "fallback" },
72 ["<Tab>"] = { "snippet_forward", "fallback" },
73 ["<S-Tab>"] = { "snippet_backward", "fallback" },
75 ["<Up>"] = { "select_prev", "fallback" },
76 ["<Down>"] = { "select_next", "fallback" },
77 ["<C-i>"] = { "select_prev", "fallback_to_mappings" },
78 ["<C-k>"] = { "select_next", "fallback_to_mappings" },
80 ["<C-j>"] = { "scroll_documentation_up", "fallback" },
81 ["<C-l>"] = { "scroll_documentation_down", "fallback" },
83 ["<C-n>"] = { "show_signature", "hide_signature", "fallback" },
87 -- Remove 'buffer' if you don't want text completions,
88 -- by default it's only enabled when LSP returns no items
89 default = { "lsp", "path", "snippets", "buffer" },
92 -- Use a preset for snippets, check the snippets documentation for more information
93 snippets = { preset = "default" }, -- | "luasnip" | "mini_snippets" | "vsnip"
95 -- Experimental signature help support
96 signature = { enabled = true },