local M = { "echasnovski/mini.surround", version = "main", event = "VeryLazy", } function M.config() require("mini.surround").setup({ mappings = { add = "s", -- Add surrounding in Normal and Visul modes delete = "d", -- Delete surrounding find = "f", -- Find surrounding (to the right) find_left = "F", -- Find surrounding (to the left) highlight = "h", -- Highlight surrounding replace = "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 = "'" }, }, }, }) end return M