return { -- Auto-pair brackets/quotes: (), {}, [], "", '' -- nvim-autopairs' -- own defaults. <> was tried here too but removed: it collided too -- much with < and > as comparison operators to be worth keeping. { "windwp/nvim-autopairs", dependencies = { "hrsh7th/nvim-cmp" }, config = function() local autopairs = require("nvim-autopairs") -- map_cr defaults to true, which makes nvim-autopairs install -- its OWN insert-mode mapping (for expanding bracket pairs -- onto their own indented line). That's set during plugin -- loading, which runs after init.lua's own top-level code -- -- where the comment-continuation mapping lives -- so it -- was silently overwriting that mapping entirely regardless of -- what it did internally. Disabled here to free up for -- that mapping; the trade-off is losing autopairs' own -- brace-expands-on-Enter behavior, which was never explicitly -- asked for. autopairs.setup({ map_cr = false }) -- Integrates with nvim-cmp so accepting a completion (e.g. a -- function call) doesn't end up with doubled-up parens. local cmp_autopairs = require("nvim-autopairs.completion.cmp") require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) end, }, }