-
-
Notifications
You must be signed in to change notification settings - Fork 126
Custom rules
Smitesh Patil edited this page May 21, 2021
·
29 revisions
This page contains custom rules, that can be added to your neovim config using add_rules
method.
Before | Insert | After |
---|---|---|
(|) |
( |) |
( | ) |
local npairs = require'nvim-autopairs'
local Rule = require'nvim-autopairs.rule'
npairs.add_rules {
Rule(' ', ' ')
:with_pair(function (opts)
local pair = opts.line:sub(opts.col, opts.col + 1)
return vim.tbl_contains({ '()', '[]', '{}' }, pair)
end)
}