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 45 46 47 48 49 50 |
return {
"saghen/blink.cmp",
dependencies = {
"rafamadriz/friendly-snippets",
{ "fang2hou/blink-copilot", dependencies = "copilot.lua" },
},
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" },
-- prob should remove but i just got too used to accepting snippets this way
["<C-l>"] = { "snippet_forward", "accept", "fallback" },
},
appearance = { nerd_font_variant = "mono" },
completion = {
documentation = {
auto_show = true,
auto_show_delay_ms = 300,
},
},
sources = {
default = { "copilot", "lsp", "path", "snippets", "buffer" },
per_filetype = {
lua = { inherit_defaults = true, "lazydev" },
},
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100,
},
copilot = {
name = "copilot",
module = "blink-copilot",
score_offset = 100,
async = true,
},
},
},
fuzzy = { -- :h blink-cmp-config-fuzzy
implementation = "prefer_rust_with_warning",
},
},
opts_extend = { "sources.default" },
}
|