-- autopairs -- https://github.com/windwp/nvim-autopairs return { 'windwp/nvim-autopairs', event = 'InsertEnter', config = function() require('nvim-autopairs').setup({ check_ts = true, ts_config = { lua = { 'string' }, -- it will not add a pair on that treesitter node javascript = { 'template_string' }, java = false, -- don't check treesitter on java }, disable_filetype = { 'TelescopePrompt', 'spectre_panel' }, fast_wrap = { map = '', chars = { '{', '[', '(', '"', "'" }, pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], '%s+', ''), offset = 0, -- Offset from pattern match end_key = '$', keys = 'qwertyuiopzxcvbnmasdfghjkl', check_comma = true, highlight = 'PmenuSel', highlight_grey = 'LineNr', }, }) -- Integration with nvim-cmp local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp = require('cmp') cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) end, }