define-command -docstring %{ pastes []: paste the selection(s) to pastes.sh. Separate selections are appended into one. Resulting URL is printed to *debug* and copied to clipboard. Arguments: name optional filename for the paste } -params 0..1 pastes %{ evaluate-commands -draft -save-regs '"ab|' %{ set-register b %val{bufname} execute-keys '"ay' edit -scratch set-register | "ssh pastes.sh %arg{1} 2>/dev/null" execute-keys '"a%|%s\rd%_"ay' set-register | "wl-copy -n" execute-keys '' echo -debug %reg{a} hook -once global WinDisplay %exp{\Q%reg{b}\E} %{ info -title 'pastes.sh' "%reg{a}" } delete-buffer } }