windwp / nvim-autopairs

autopairs for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

correct way to add a new rule

deshearth opened this issue · 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,
}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.