From ad5ca55b5a17ae30112d1e665a05eaa856da18cb Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sun, 8 Jun 2025 21:49:00 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-08 21:49:00 --- .config/kak/autoload/clipboard.kak | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.config/kak/autoload/clipboard.kak b/.config/kak/autoload/clipboard.kak index e9cd1c74..16d6d758 100644 --- a/.config/kak/autoload/clipboard.kak +++ b/.config/kak/autoload/clipboard.kak @@ -1,24 +1,29 @@ # Goal: better multi-selection behavior # If we copy multiple selections, it should be copied s.t. each selection is on its own line -define-command clip-copy-split %{ +declare-option -docstring %{ + Command for copying to system clipboard +} str clipboard_copy_cmd 'wl-copy' + +define-command -docstring %{ + Copies selections to system clipboard, splitting each selection onto new lines. +} clip-copy-split %{ evaluate-commands -save-regs 'a' %{ - # copy all selections execute-keys '"ay' - # create a scratch buffer edit -scratch - # paste all selections, separate lines, delete last newline - # select all, copy to clipboard execute-keys '"aagjd%wl-copy' delete-buffer } } -define-command clip-copy %{ +define-command -docstring %{ + Copies selections to system clipboard, does not split selections onto new lines. +} clip-copy-verbatim %{ evaluate-commands -save-regs 'a' %{ execute-keys '"ay' edit -scratch execute-keys '"agjd%wl-copy' + delete-buffer } }