fix(autocomplete): disable cmp cr mapping that was messing with autopairs

This commit is contained in:
Matt Leong 2021-10-22 17:56:55 -07:00
parent 6ff029a0c8
commit 6b1da29c14

View file

@ -21,10 +21,11 @@ cmp.setup({
['<C-u>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
-- disabled for autopairs mapping
--[[ ['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
}), ]]
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -59,13 +60,13 @@ cmp.setup({
experimental = {
ghost_text = true,
},
sources = {
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'nvim_lua' },
{ name = 'buffer' },
{ name = 'luasnip' },
{ name = 'path' },
},
}),
formatting = {
format = require('lspkind').cmp_format({
with_text = true,