init.lua/lua/plugins/completion.lua(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
return {
"saghen/blink.cmp",
dependencies = {
"rafamadriz/friendly-snippets",
},
version = "1.*",
event = "InsertEnter",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = "enter",
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" },
["<C-l>"] = { "snippet_forward", "accept", "fallback" },
},
completion = {
documentation = {
auto_show = true,
auto_show_delay_ms = 300,
},
},
sources = {
default = { "lsp", "path", "snippets", "buffer" },
per_filetype = {
lua = { inherit_defaults = true, "lazydev" },
},
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
},
},
},
config = function(_, opts)
require("blink.cmp").setup(opts)
vim.lsp.config("*", {
flags = { debounce_text_changes = 150 },
capabilities = require("blink.cmp").get_lsp_capabilities(),
})
end,
}
|