fix(autocomplete): update autopairs setting

This commit is contained in:
Matt Leong 2021-10-28 08:41:17 -07:00
parent 303d01b3e8
commit 9b64d35ad3

View file

@ -22,10 +22,10 @@ cmp.setup({
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
-- disabled for autopairs mapping
--[[ ['<CR>'] = cmp.mapping.confirm({
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}), ]]
}),
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -85,13 +85,6 @@ require('nvim-autopairs').setup({
disable_filetype = { 'TelescopePrompt', 'vim' },
})
require('nvim-autopairs.completion.cmp').setup({
map_cr = true, -- map <CR> on insert mode
map_complete = true, -- it will auto insert `(` (map_char) after select function or method item
auto_select = true, -- automatically select the first item
insert = false, -- use insert confirm behavior instead of replace
map_char = { -- modifies the function or method delimiter by filetypes
all = '(',
tex = '{',
},
})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())