AutoYADM commit: 2025-05-21 15:28:39

This commit is contained in:
Daniel Fichtinger 2025-05-21 15:28:39 -04:00
parent 900e7e4437
commit 327e2877cf

View file

@ -0,0 +1,41 @@
declare-user-mode surround-add
define-command -override surround-add-pair -params 2 %{
evaluate-commands -draft -save-regs '"' %{
set-register '"' %arg{1}
execute-keys -draft P
set-register '"' %arg{2}
execute-keys -draft p
}
}
# command surrounds with any arbitrary character
define-command -override surround-add -params 1 %{
evaluate-commands -draft -save-regs '"' %{
set-register '"' %arg{1}
execute-keys -draft P
execute-keys -draft p
}
}
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 %{
on-key %{
surround-delete-key %val{key}
}
}
map global surround-add ( ':surround-add-pair ( )<ret>' -docstring 'surround with parenthesis'
map global surround-add ) ':surround-add-pair ( )<ret>' -docstring 'surround with parenthesis'
map global surround-add [ ':surround-add-pair [ ]<ret>' -docstring 'surround with brackets'
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 ""'"" ""'""<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'