A minimal, fast, and extensible Neovim plugin for automatic insertion and management of paired characters (brackets, quotes, etc.) in insert mode. Written in Lua.
- Automatically inserts closing pairs when typing opening characters.
- Skips insertion inside Treesitter nodes (by default
commendandstring) - Smart handling of quotes and backticks.
- Jump over closing pairs if already present.
- Deletes both sides of an empty pair with backspace.
- Inserts new lines inside empty pairs with proper indentation.
- Easily configurable and extensible.
Use your favorite plugin manager. Example with lazy.nvim:
{
"Marfien/simple-pairs.nvim",
event = "InsertEnter",
config = function()
require("simple-pairs-nvim").setup()
end
}You can override the default configuration in your setup:
require("simple-pairs-nvim").setup({
ignored = {
ts_nodes = { "string", "comment" }, -- Treesitter nodes to ignore
filetypes = { },
},
pairs = {
["("] = ")",
["["] = "]",
["{"] = "}",
['"'] = '"',
["'"] = "'",
["`"] = "`",
},
})- Uses Treesitter to avoid inserting pairs inside strings and comments.
- Handles opening and closing pairs, quotes, backspace, and enter.
- Keymaps are set in insert mode for all configured pairs.
MIT