1
0
Fork 0

nvim: add new surroundings

This commit is contained in:
Luca Bilke 2024-06-30 12:07:01 +02:00
parent 18b68dc8b5
commit 3e9bfd0466
No known key found for this signature in database
GPG Key ID: C9E851809C1A5BDE
1 changed files with 15 additions and 0 deletions

View File

@ -92,11 +92,26 @@ return {
"echasnovski/mini.surround",
optional = true,
opts = {
highlight_duration = 0,
custom_surroundings = {
B = {
input = { "{{ ().*() }}" },
output = { left = "{{ ", right = " }}" },
},
M = {
input = { "{% ().*() %}" },
output = { left = "{% ", right = " %}" },
},
T = {
input = { "%f[%w_%.][%w_%.]+%b<>", "^.-<().*()>$" },
output = function()
local type_name = require("mini.surround").user_input("Type name")
if type_name == nil then
return nil
end
return { left = ("%s<"):format(type_name), right = ">" }
end,
},
},
},
},