/dumb-autopairs.nvim

dumb autopairs for neovim written in lua

Primary LanguageLuaMIT LicenseMIT

dumb-autopairs.nvim

A dumb autopairs plugin for Neovim that tries not to get in your way.

It handles inserting closing braces/quotes, <CR> and <BS>. It does not attempt to wrap existing text.

<CR> works best with these settings:

vim.o.autoindent = true
vim.cmd("filetype plugin indent on")

Installation

Using your favourite package manager:

{
    "mgnsk/dumb-autopairs.nvim",
    event = "InsertEnter",
    config = function()
        require("dumb-autopairs").setup()
    end,
},

Default config

{
    pairs = {
        {
            left = "(",
            right = ")",
        },
        {
            left = "[",
            right = "]",
        },
        {
            left = "{",
            right = "}",
        },
        {
            left = '"',
            right = '"',
        },
        {
            left = "'",
            right = "'",
        },
        {
            left = "`",
            right = "`",
        },
    },
}

Note: only single-character braces/quotes are supported.