diff --git a/docs/configuration_recipes.md b/docs/configuration_recipes.md index 89a73b1..a508c10 100644 --- a/docs/configuration_recipes.md +++ b/docs/configuration_recipes.md @@ -145,3 +145,21 @@ vim.keymap.set("i", "", function() end end) ``` + +## Use with nvim-autopairs + +```lua +"windwp/nvim-autopairs", +lazy = false, +config = function() + local npairs = require("nvim-autopairs") + npairs.setup({ map_cr = false }) + vim.keymap.set("i", "", function() + if require("care").api.is_open() then + require("care").api.confirm() + else + vim.fn.feedkeys(require("nvim-autopairs").autopairs_cr(), "in") + end + end) +end, +```