mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 06:32:40 +00:00
feat: Updates nvim-cmp
This commit is contained in:
@@ -32,19 +32,26 @@ return {
|
|||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
["<C-Space>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true,
|
||||||
|
}), -- select completion, this makes it so it doesn't auto complete when suggesting.
|
||||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||||
["<CR>"] = cmp.mapping(function(fallback)
|
["<CR>"] = cmp.mapping({
|
||||||
|
i = function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
if luasnip.expandable() then
|
if luasnip.expandable() then
|
||||||
luasnip.expand()
|
luasnip.expand()
|
||||||
else
|
else
|
||||||
cmp.confirm({ select = true })
|
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end),
|
end,
|
||||||
|
s = cmp.mapping.confirm({ select = true }),
|
||||||
|
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||||
|
}),
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- The next two mappings are also implemented in the LuaSnip configuration,
|
-- The next two mappings are also implemented in the LuaSnip configuration,
|
||||||
-- as <C-j> and <C-k> do they actually need to be here??
|
-- as <C-j> and <C-k> do they actually need to be here??
|
||||||
|
|||||||
Reference in New Issue
Block a user