Files
nvim/lua/plugins/blink.lua

94 lines
2.3 KiB
Lua

return {
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = {
{
'saghen/blink.compat',
-- use v2.* for blink.cmp v1.*
version = '2.*',
lazy = true,
opts = {},
},
'rafamadriz/friendly-snippets',
'dmitmel/cmp-cmdline-history',
'fang2hou/blink-copilot',
},
-- use a release tag to download pre-built binaries
version = '1.*',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
-- 'super-tab' for mappings similar to vscode (tab to accept)
-- 'enter' for enter to accept
-- 'none' for no mappings
--
-- All presets have the following mappings:
-- C-space: Open menu or open docs if already open
-- C-n/C-p or Up/Down: Select next/previous item
-- C-e: Hide menu
-- C-k: Toggle signature help (if signature.enabled = true)
keymap = { preset = 'enter' },
appearance = {
nerd_font_variant = 'mono',
},
-- (Default) Only show the documentation popup when manually triggered
completion = {
documentation = { auto_show = true },
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot' },
providers = {
lsp = {
fallbacks = {},
},
cmdline_history = {
name = 'cmdline_history',
module = 'blink.compat.source',
score_offset = -3,
},
copilot = {
name = 'copilot',
module = 'blink-copilot',
score_offset = 100,
async = true,
},
},
},
snippets = {
preset = 'luasnip',
},
signature = {
enabled = true,
},
cmdline = {
keymap = { preset = 'inherit' },
completion = {
menu = { auto_show = true },
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
},
sources = { 'buffer', 'cmdline', 'cmdline_history' },
},
fuzzy = { implementation = 'prefer_rust_with_warning' },
},
opts_extend = { 'sources.default' },
}