Add custom mapping for replacing HTML tags without losing attributes
This commit is contained in:
parent
3410eb095b
commit
ed79c419c8
17
init.lua
17
init.lua
|
|
@ -950,7 +950,22 @@ require('lazy').setup({
|
|||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
||||
-- - sd' - [S]urround [D]elete [']quotes
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require('mini.surround').setup()
|
||||
require('mini.surround').setup {
|
||||
custom_surroundings = {
|
||||
-- - srTT - [S]urround [R]eplace [T]ag opening [T]ag closing
|
||||
-- ^ allows to replace the surrounding tag with another one without losing any added attributes
|
||||
T = {
|
||||
input = { '<(%w+)[^<>]->.-</%1>', '^<()%w+().*</()%w+()>$' },
|
||||
output = function()
|
||||
local tag_name = MiniSurround.user_input 'Tag name'
|
||||
if tag_name == nil then
|
||||
return nil
|
||||
end
|
||||
return { left = tag_name, right = tag_name }
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
require('mini.move').setup()
|
||||
|
||||
-- Simple and easy statusline.
|
||||
|
|
|
|||
Loading…
Reference in New Issue