From ce291bed7869693dc7992e49d3044af88867b43c Mon Sep 17 00:00:00 2001 From: Alexander Kidd Date: Wed, 14 Feb 2024 11:14:05 -0500 Subject: [PATCH] added autopair plugin --- lazy-lock.json | 1 + lua/custom/plugins/autopairs.lua | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 lua/custom/plugins/autopairs.lua diff --git a/lazy-lock.json b/lazy-lock.json index 2a398a7c..348d37af 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -16,6 +16,7 @@ "neo-tree.nvim": { "branch": "main", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, "neodev.nvim": { "branch": "main", "commit": "365ef03dbf5b8579e6eb205b3500fc3bee17484a" }, "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, + "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-dap": { "branch": "master", "commit": "3b4bdea2c0e9ed356d8cffbf974f3d0af891bbea" }, "nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" }, diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..c5531fa4 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,18 @@ +-- File: lua/custom/plugins/autopairs.lua + +return { + "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, +} +