.dotfiles/.config/nvim/lua/nvwynd/plugins/completion.lua

64 lines
1.2 KiB
Lua

return {
{
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
enabled = function()
return not vim.tbl_contains({ "markdown" }, vim.bo.filetype)
and vim.bo.buftype ~= "prompt"
and vim.b.completion ~= false
end,
keymap = { preset = "enter" },
appearance = {
nerd_font_variant = "mono",
},
signature = { enabled = true },
fuzzy = {
sorts = {
"exact",
"score",
"sort_text",
},
},
sources = {
transform_items = function(_, items)
return vim.tbl_filter(function(item)
return item.kind ~= require("blink.cmp.types").CompletionItemKind.Snippet
end, items)
end,
},
completion = {
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
accept = {
auto_brackets = { enabled = false },
},
ghost_text = {
enabled = true,
show_with_menu = true,
show_without_menu = true,
},
menu = {
draw = {
treesitter = { "lsp" },
columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { "kind" } },
},
},
},
},
},
}