Closed honestSalami closed 2 years ago
I thought about appending each dot to a register, and then sending that register to xsel, but I don't know how to 1) save dots to a register, nor how to 2) execute a command after ALL matches have been made.
I found a way to send each line to the system clipboard, but without linebreaks: :,x > xsel -ab
here's how you can send the entire file to the clipboard: ,x/(.|\n)+/ > xsel -ib
.
and you can do the same appending trick above for any selection: ,x/regex/ > xsel -ab
.
Since this is what I set out to do, I'll consider this issue closed.
I'm trying to send all lines that contain a pattern to the system clipboard. This is useful if (for example) I want all the function definitions in a python file.
My attempt thus far has been
,x/.+\n/ g/regex/ > xsel -ip
, but that only writes the LAST line containing the pattern to the clipboard (probably because each new dot overwrites the previously written dot). How can I send the ENTIRE selection to the clipboard?