diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index fecbd0d..2e28264 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -222,8 +222,8 @@ return { "windwp/nvim-autopairs", commit = "4fc96c8f3df89b6d23e5092d31c866c53a346347", dependencies = "hrsh7th/nvim-cmp", - event = "VeryLazy", - init = function() + event = "InsertEnter", + config = function() require("user.autopairs") end, }, diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua index d2966e6..3d49991 100644 --- a/lua/user/autopairs.lua +++ b/lua/user/autopairs.lua @@ -25,6 +25,7 @@ npairs.setup({ }, }) +-- If you want insert `(` after select function or method item local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_status_ok, cmp = pcall(require, "cmp") if not cmp_status_ok then