fix: finally don't spam paths on comment tab

This commit is contained in:
Fabio Lenherr / DashieTM 2023-04-05 23:58:40 +02:00
parent ff98e6fbf0
commit 39142a5231
6 changed files with 136 additions and 33 deletions

View file

@ -29,8 +29,9 @@ return {
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"FelipeLema/cmp-async-path",
"saadparwaiz1/cmp_luasnip",
"Saecki/crates.nvim",
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
},
opts = function()
@ -53,9 +54,9 @@ return {
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<S-CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}), -- Accept cur
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}), -- Accept cur
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -97,10 +98,11 @@ return {
}),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lsp", priority = 99 },
{ name = "luasnip", priority = 10, max_item_count = 3 },
{ name = "buffer", priority = 5, max_item_count = 2, keyword_length = 5 },
{ name = "async_path", priority = 0, max_item_count = 2, keyword_length = 3, trigger_characters = {} },
{ name = "crates" },
}),
formatting = {
format = function(entry, item)