fix: correct mapping for snippet insertion in completion

This commit is contained in:
2024-12-18 14:24:34 -05:00
parent d2bda27817
commit 00a78e028b
+15 -4
View File
@@ -22,6 +22,7 @@ local function cmp_provider(performance)
}
end
end
local cmp_repo = cmp_provider(perf)
if vim.g.useblinkcmp then
@@ -40,8 +41,13 @@ if vim.g.useblinkcmp then
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-e>'] = { 'hide', 'fallback' },
['<C-y>'] = {
LazyVim.cmp.map({ 'select_and_accept', 'ai_accept' }),
'fallback',
},
['<Tab>'] = {
LazyVim.cmp.map({ 'snippet_forward', 'ai_accept' }),
'snippet_forward',
'fallback',
},
['<S-Tab>'] = { 'snippet_backward', 'fallback' },
@@ -76,7 +82,9 @@ if vim.g.useblinkcmp then
end
-- Else use classic cmp
return { -- cmp
return {
{ import = 'lazyvim.plugins.extras.coding.nvim-cmp' },
{ -- cmp
url = cmp_repo.url,
build = cmp_repo.build,
branch = cmp_repo.branch,
@@ -198,8 +206,10 @@ return { -- cmp
dotenv = ' Dotenv',
cmp_yanky = '󰅍 Yanked',
}
local color_item =
require('nvim-highlight-colors').format(entry, { kind = item.kind })
local color_item = require('nvim-highlight-colors').format(
entry,
{ kind = item.kind }
)
item = require('lspkind').cmp_format({
require('tailwind-tools.cmp').lspkind_format,
})(entry, item)
@@ -258,4 +268,5 @@ return { -- cmp
})
end
end,
},
}