1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update nvim-cmp conf, fix hrsh7th/nvim-cmp#880

This commit is contained in:
jdhao 2022-04-10 13:07:02 +08:00
parent 639b3d6067
commit 3134f088cd

View File

@ -10,20 +10,26 @@ cmp.setup({
end, end,
}, },
mapping = { mapping = {
['<Tab>'] = function(fallback) ['<Tab>'] = {
i = function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
else else
fallback() fallback()
end end
end, end,
['<S-Tab>'] = function(fallback) c = cmp.config.disable
},
['<S-Tab>'] = {
i = function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
else else
fallback() fallback()
end end
end, end,
c = cmp.config.disable
},
['<Esc>'] = cmp.mapping.close(), ['<Esc>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = true }), ['<CR>'] = cmp.mapping.confirm({ select = true }),
['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(-4),