sdf but for templates/generics
#2083
-
Contributing guidelines
Module(s)mini.surround Question
Is there a way to customize Also slightly orthogonal but similar. Often function calls have a path in them e.g. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Of course. You can pretty much reuse how require('mini.surround').setup({
custom_surroundings = {
t = {
input = { '%f[%w_%.][%w_%.]+%b<>', '^.-<().*()>$' },
output = function()
local fun_name = MiniSurround.user_input('Template name')
if fun_name == nil then return nil end
return { left = fun_name .. '<', right = '>' }
end,
},
},
})A more reasonable approach would be to only redefine this surrounding for filetypes that you want. For example:
By default require('mini.surround').setup({
custom_surroundings = {
f = { input = { '%f[%w_%.:][%w_%.:]+%b()', '^.-%(().*()%)$' } },
},
}) |
Beta Was this translation helpful? Give feedback.
Of course. You can pretty much reuse how
fitself is defined. Here is an example of how to do it fortsurrounding (will override "tag" surrounding). Here is how to do it globally: