nvim/lua/plugins/autopairs.lua

29 lines
583 B
Lua
Raw Normal View History

2022-12-31 17:43:31 +01:00
local M = {
'windwp/nvim-autopairs',
event = 'InsertEnter'
}
function M.config()
local npairs = require 'nvim-autopairs'
npairs.setup {
check_ts = true, -- treesitter integration
fast_wrap = {
map = '<C-e>',
highlight = 'Search',
highlight_grey = 'Comment',
},
map_c_w = true,
-- disable_filetype = { "TelescopePrompt" },
}
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp_status_ok, cmp = pcall(require, 'cmp')
if not cmp_status_ok then
return
end
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done {})
end
return M