nvim-autopairs icon indicating copy to clipboard operation
nvim-autopairs copied to clipboard

correct way to add a new rule

Open deshearth opened this issue 3 months ago • 0 comments

Description

I am using lazy.vim to manage plugins. Is the following the correct way to add custom rules.

{
    'windwp/nvim-autopairs',
    event = "InsertEnter",
    config = function ()
      local Rule = require('nvim-autopairs.rule')
      local npairs = require('nvim-autopairs')
      npairs.setup()
      npairs.add_rule(Rule("$","$","tex"))
    end,
}

Other default pairing rules work properly

Mapping bug

1.If you report a bug about indent. Please remember that plugin doesn't do anything about indent. It just trigger the indent of your vim config so if you have wrong indent config then it will do wrong indent. You can check by select a block of code and press == 2. provide result of command :verbose imap <cr>.

Steps to reproduce

No response

Minimal config

{
    'windwp/nvim-autopairs',
    event = "InsertEnter",
    config = function ()
      local Rule = require('nvim-autopairs.rule')
      local npairs = require('nvim-autopairs')
      npairs.setup()
      npairs.add_rule(Rule("$","$","tex"))
    end,
}

deshearth avatar Mar 25 '24 22:03 deshearth