From b7c63d5b72bd4ce41fe561d4a2ee46893445be7c Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 21 May 2025 15:43:56 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-21 15:43:56 --- .config/kak/autoload/colemak.kak | 2 +- .config/kak/autoload/surround.kak | 28 ++++++++++++++++++++++++++-- .config/kak/kakrc | 2 ++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.config/kak/autoload/colemak.kak b/.config/kak/autoload/colemak.kak index 3da7cd3d..f9cadd6a 100644 --- a/.config/kak/autoload/colemak.kak +++ b/.config/kak/autoload/colemak.kak @@ -5,7 +5,7 @@ map global normal n "j" map global normal e "k" map global normal i "l" map global normal h "i" -map global normal k "m" +# map global normal k "m" map global normal j "n" map global normal l "e" diff --git a/.config/kak/autoload/surround.kak b/.config/kak/autoload/surround.kak index 522f5700..49e939a6 100644 --- a/.config/kak/autoload/surround.kak +++ b/.config/kak/autoload/surround.kak @@ -1,3 +1,4 @@ +declare-user-mode surround declare-user-mode surround-add define-command -override surround-add-pair -params 2 %{ evaluate-commands -draft -save-regs '"' %{ @@ -27,15 +28,38 @@ define-command surround-delete %{ } } +define-command -hidden surround-replace-sub -params 1 %{ + on-key %{ + evaluate-commands -no-hooks -draft %{ + execute-keys "%arg{1}" + enter-user-mode surround-add + execute-keys %val{key} + } + + surround-delete-key %arg{1} + } +} + +define-command surround-replace %{ + on-key %{ + surround-replace-sub %val{key} + } +} + map global surround-add ( ':surround-add-pair ( )' -docstring 'surround with parenthesis' map global surround-add ) ':surround-add-pair ( )' -docstring 'surround with parenthesis' map global surround-add [ ':surround-add-pair [ ]' -docstring 'surround with brackets' map global surround-add ] ':surround-add-pair [ ]' -docstring 'surround with brackets' -map global surround-add { ':surround-add-pair { }ret>' -docstring 'surround with braces' +map global surround-add { ':surround-add-pair { }' -docstring 'surround with braces' map global surround-add } ':surround-add-pair { }' -docstring 'surround with braces' -map global surround-add < ':surround-add-pair < >ret>' -docstring 'surround with angles' +map global surround-add < ':surround-add-pair "<" ">"' -docstring 'surround with angles' map global surround-add > ':surround-add-pair < >' -docstring 'surround with angles' map global surround-add "'" ":surround-add-pair ""'"" ""'""" -docstring 'surround with quotes' map global surround-add '"' ":surround-add-pair '""' '""'" -docstring 'surround with double quotes' map global surround-add * ':surround-add-pair * *' -docstring 'surround with asteriks' map global surround-add _ ':surround-add-pair _ _' -docstring 'surround with undescores' + +map -docstring 'surround' global normal k ': enter-user-mode surround' +map -docstring 'add surrounding' global surround s ': enter-user-mode surround-add' +map -docstring 'delete surrounding' global surround d ':surround-delete' +map -docstring 'replace surrounding' global surround r ':surround-replace' diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 598766cb..d4e4013b 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -116,3 +116,5 @@ map -docstring 'pick unopened file' global peneira F ': peneira-files -hide-open map -docstring %{ pick line in buffer } global peneira '/' ': peneira-lines' + +# source "%val{config}/autoload/surround.kak"