AutoYADM commit: 2025-07-22 00:56:42

This commit is contained in:
Daniel Fichtinger 2025-07-22 00:56:42 -04:00
parent 1b72de2a95
commit 8f7a026548

View file

@ -3,6 +3,17 @@ declare-option -docstring %{
Command for copying to system clipboard.
} str clipboard_copy_cmd 'wl-copy'
declare-option str clipboard_strip_cmd %{
perl -ne '
BEGIN { $prefix = undef }
if (!defined $prefix) {
($prefix) = /^([ \t]*)/;
}
s/^\Q$prefix\E//;
print;
' | wl-copy
}
declare-option int clip_selcount 0
define-command -hidden clip-trim %{
@ -12,6 +23,13 @@ define-command -hidden clip-trim %{
}
}
define-command clip-copy-strip %{
evaluate-commands -save-regs '|' %{
set-register | %opt{clipboard_strip_cmd}
execute-keys '<a-|><ret>'
}
}
define-command -docstring %{
clip-copy [-split]: copy selections to system clipboard
Set the clipboard_copy_cmd option to change the command
@ -52,6 +70,7 @@ define-command -docstring %{
map -docstring "yank the selections into the clipboard" global user y ": clipboard-copy<ret>"
map -docstring "yank the split selections into the clipboard" global user Y ": clipboard-copy -split<ret>"
map -docstring "yank main selection, strip leading whitespace" global user <a-y> ': clip-copy-strip<ret>'
map -docstring "paste the clipboard" global user p "<a-!> wl-paste -n<ret>"
map -docstring "paste the clipboard before" global user P "! wl-paste -n<ret>"