vim

Log | Files | Refs

autopairs.lua (722B)


      1 return {
      2   {
      3     "windwp/nvim-autopairs",
      4     event = "InsertEnter",
      5     dependencies = { "hrsh7th/nvim-cmp" },
      6     config = function()
      7       require("nvim-autopairs").setup({
      8         check_ts = true,  -- use treesitter to avoid pairing inside strings/comments
      9         ts_config = {
     10           python = { "string", "comment" },
     11           bash   = { "string" },
     12         },
     13         fast_wrap = {
     14           map = "<M-e>",  -- Alt-e wraps the word under cursor in a pair
     15         },
     16       })
     17 
     18       -- Auto-insert closing bracket when confirming a completion item
     19       local cmp_autopairs = require("nvim-autopairs.completion.cmp")
     20       require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
     21     end,
     22   },
     23 }