neovim-confs/lua/plex/plugins/extras/coding/autopairs.lua

19 lines
568 B
Lua
Raw Permalink Normal View History

2023-09-06 00:26:45 +02:00
return {
{
'windwp/nvim-autopairs',
dependencies = 'hrsh7th/nvim-cmp',
config = function()
local autopairs = require('nvim-autopairs')
autopairs.setup()
-- Disable [ rule, it interferes with zk-nvim link completion.
local cond = require('nvim-autopairs.conds')
autopairs.get_rule('['):with_pair(cond.not_filetypes({ 'markdown' }))
-- Insert `(` after function or method item selection.
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
require('cmp').event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
},
}