From 4a1e2eacc843961b031508ee853d9b2eee7ad8c6 Mon Sep 17 00:00:00 2001 From: Carlos Hurtado <52082645+carlosahs@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:32:34 -0600 Subject: [PATCH] feat: add autopairs plugin --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index 7bbfdc94..6dcb297b 100644 --- a/init.lua +++ b/init.lua @@ -252,6 +252,20 @@ require('lazy').setup({ -- This is equivalent to: -- require('Comment').setup({}) + -- autopairs to close pairs + { + 'windwp/nvim-autopairs', + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, + }, + -- "gc" to comment visual regions/lines { 'numToStr/Comment.nvim', opts = {} },