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 ["<Tab>"] = { "accept", "fallback" },
71 --["<CR>"] = { "accept", "fallback" },
73 --["<Tab>"] = { "snippet_forward", "fallback" },
74 --["<S-Tab>"] = { "snippet_backward", "fallback" },
76 ["<Up>"] = { "select_prev", "fallback" },
77 ["<Down>"] = { "select_next", "fallback" },
78 ["<C-i>"] = { "select_prev", "fallback_to_mappings" },
79 ["<C-k>"] = { "select_next", "fallback_to_mappings" },
81 ["<C-j>"] = { "scroll_documentation_up", "fallback" },
82 ["<C-l>"] = { "scroll_documentation_down", "fallback" },
84 ["<C-n>"] = { "show_signature", "hide_signature", "fallback" },
88 -- Remove 'buffer' if you don't want text completions,
89 -- by default it's only enabled when LSP returns no items
90 default = { "lsp", "path", "snippets", "buffer" },
93 -- Use a preset for snippets, check the snippets documentation for more information
94 snippets = { preset = "default" }, -- | "luasnip" | "mini_snippets" | "vsnip"
96 -- Experimental signature help support
97 signature = { enabled = true },