From f8a7503d756840985444d6811f6cc410f4b08249 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 27 Jun 2025 22:46:31 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-27 22:46:31 --- .config/kak/autoload/xml.kak | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.config/kak/autoload/xml.kak b/.config/kak/autoload/xml.kak index 85e50726..2865779a 100644 --- a/.config/kak/autoload/xml.kak +++ b/.config/kak/autoload/xml.kak @@ -9,6 +9,23 @@ define-command -hidden -params 1 xml-surround-add-impl %~ define-command -hidden -params 1 xml-surround-remove-impl %~ evaluate-commands -save-regs 'a"' -no-hooks %^ set-register a %arg{1} - execute-keys -save-regs '"' -draft 'ad//ad' + execute-keys -save-regs '"' -draft 'ad//ad' ^ ~ + +define-command xml-surround-add %{ + prompt add: %{ + xml-surround-add-impl %val{text} + } +} +define-command xml-surround-remove %{ + prompt remove: %{ + xml-surround-remove-impl %val{text} + } +} + +hook global WinSetOption filetype=(xml|html|markdown) %{ + declare-filetype-mode %opt{filetype} + map window %opt{filetype} s ': xml-surround-add' -docstring 'tag surround add' + map window %opt{filetype} r ': xml-surround-remove' -docstring 'tag surround remove' +}