AutoYADM commit: 2025-05-21 15:59:10

This commit is contained in:
Daniel Fichtinger 2025-05-21 15:59:10 -04:00
parent b7c63d5b72
commit 6e302b83e0

View file

@ -10,7 +10,7 @@ define-command -override surround-add-pair -params 2 %{
}
# command surrounds with any arbitrary character
define-command -override surround-add -params 1 %{
define-command -override -hidden surround-add-key -params 1 %{
evaluate-commands -draft -save-regs '"' %{
set-register '"' %arg{1}
execute-keys -draft P
@ -18,11 +18,24 @@ define-command -override surround-add -params 1 %{
}
}
define-command surround-add %{
info -title surround "Enter character to add"
on-key %{
nop %sh{
if [ "$kak_key" != "<esc>" ]; then
printf '%s' 'surround-add-key %val{key}'
fi
}
}
}
define-command -hidden surround-delete-key -params 1 %{
execute-keys -draft "<a-a>%arg{1}i<del><esc>a<backspace><esc>"
}
define-command surround-delete %{
info -title surround "Enter character to delete"
on-key %{
surround-delete-key %val{key}
}
@ -41,6 +54,7 @@ define-command -hidden surround-replace-sub -params 1 %{
}
define-command surround-replace %{
info -title surround "Enter character to replace"
on-key %{
surround-replace-sub %val{key}
}
@ -52,12 +66,13 @@ map global surround-add [ ':surround-add-pair [ ]<ret>' -docstring 'su
map global surround-add ] ':surround-add-pair [ ]<ret>' -docstring 'surround with brackets'
map global surround-add { ':surround-add-pair { }<ret>' -docstring 'surround with braces'
map global surround-add } ':surround-add-pair { }<ret>' -docstring 'surround with braces'
map global surround-add < ':surround-add-pair "<" ">"<ret>' -docstring 'surround with angles'
map global surround-add > ':surround-add-pair < ><ret>' -docstring 'surround with angles'
map global surround-add < ':surround-add-pair <lt> <gt><ret>' -docstring 'surround with angles'
map global surround-add > ':surround-add-pair <lt> <gt><ret>' -docstring 'surround with angles'
map global surround-add "'" ":surround-add-pair ""'"" ""'""<ret>" -docstring 'surround with quotes'
map global surround-add '"' ":surround-add-pair '""' '""'<ret>" -docstring 'surround with double quotes'
map global surround-add * ':surround-add-pair * *<ret>' -docstring 'surround with asteriks'
map global surround-add _ ':surround-add-pair _ _<ret>' -docstring 'surround with undescores'
map global surround-add s ':surround-add<ret>' -docstring 'surround custom character'
map -docstring 'surround' global normal k ': enter-user-mode surround<ret>'
map -docstring 'add surrounding' global surround s ': enter-user-mode surround-add<ret>'