diff --git a/nvim/.config/nvim/lua/plugins/base.lua b/nvim/.config/nvim/lua/plugins/base.lua index e0fcfb1..0f8590e 100644 --- a/nvim/.config/nvim/lua/plugins/base.lua +++ b/nvim/.config/nvim/lua/plugins/base.lua @@ -250,7 +250,33 @@ return { require("mini.map").setup() require("mini.move").setup() require("mini.operators").setup() - require("mini.pairs").setup() + require("mini.pairs").setup({ + mappings = { + -- these mappings ensure that when trying to _close_ any of the pairs + -- it will not double insert: + -- " <- you are here. Normal pairs will do """. This config will do "". + ['"'] = { + action = "closeopen", + pair = '""', + neigh_pattern = '[^\\"].', + register = { cr = false }, + }, + ["'"] = { + action = "closeopen", + pair = "''", + neigh_pattern = "[^%a\\'].", + register = { cr = false }, + }, + ["`"] = { + action = "closeopen", + pair = "``", + neigh_pattern = "[^\\`].", + register = { cr = false }, + }, + ["<"] = { action = "open", pair = "<>", neigh_pattern = "\r." }, + [">"] = { action = "close", pair = "<>" }, + }, + }) require("mini.trailspace").setup() end, })