2023-01-10 02:38:06 +01:00
|
|
|
local M = {
|
2023-08-29 14:24:30 +02:00
|
|
|
"echasnovski/mini.surround",
|
2023-01-10 02:38:06 +01:00
|
|
|
event = "VeryLazy",
|
|
|
|
}
|
|
|
|
|
|
|
|
function M.config()
|
2023-08-29 14:24:30 +02:00
|
|
|
require("mini.surround").setup({
|
|
|
|
mappings = {
|
|
|
|
add = "<tab>s", -- Add surrounding in Normal and Visul modes
|
|
|
|
delete = "<tab>d", -- Delete surrounding
|
|
|
|
find = "<tab>f", -- Find surrounding (to the right)
|
|
|
|
find_left = "<tab>F", -- Find surrounding (to the left)
|
|
|
|
highlight = "<tab>h", -- Highlight surrounding
|
|
|
|
replace = "<tab>r", -- Replace surrounding
|
|
|
|
update_n_lines = "", -- Update `n_lines`
|
|
|
|
},
|
|
|
|
custom_surroundings = {
|
|
|
|
["b"] = {
|
|
|
|
input = { "%b()", "^.%s*().-()%s*.$" },
|
|
|
|
output = { left = "(", right = ")" },
|
|
|
|
},
|
|
|
|
["B"] = {
|
|
|
|
input = { "%b{}", "^.%s*().-()%s*.$" },
|
|
|
|
output = { left = "{", right = "}" },
|
|
|
|
},
|
|
|
|
["r"] = {
|
|
|
|
input = { "%b[]", "^.%s*().-()%s*.$" },
|
|
|
|
output = { left = "[", right = "]" },
|
|
|
|
},
|
|
|
|
["q"] = {
|
|
|
|
input = { '".-"', "^.().*().$" },
|
|
|
|
output = { left = '"', right = '"' },
|
|
|
|
},
|
|
|
|
["a"] = {
|
|
|
|
input = { "'.-'", "^.().*().$" },
|
|
|
|
output = { left = "'", right = "'" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2023-01-10 02:38:06 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|