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

64 lines
1.2 KiB
Lua
Raw Normal View History

2024-05-24 16:07:28 +03:00
return {
{
"saghen/blink.cmp",
dependencies = "rafamadriz/friendly-snippets",
2026-01-17 23:21:53 +02:00
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" },
2024-05-24 16:07:28 +03:00
appearance = {
nerd_font_variant = "mono",
},
2024-05-24 16:07:28 +03:00
signature = { enabled = true },
2024-05-24 16:07:28 +03:00
2026-01-17 23:21:53 +02:00
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 = {
2026-01-17 23:21:53 +02:00
selection = {
preselect = false,
auto_insert = false,
},
},
accept = {
auto_brackets = { enabled = false },
},
2026-01-17 23:21:53 +02:00
ghost_text = {
enabled = true,
show_with_menu = true,
show_without_menu = true,
},
menu = {
draw = {
2026-01-17 23:21:53 +02:00
treesitter = { "lsp" },
columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { "kind" } },
2024-05-24 16:07:28 +03:00
},
},
},
},
2024-05-24 16:07:28 +03:00
},
}