I’m using the following command to copy all lines of text in a document to the system clipboard:
%y+
Usually, especially in order to copy code to StackOverflow ;), I apply a sed transformation to my buffer in order to make it easier to paste in with MarkDown:
%s:^:\t:g
Is there a way to chain the commands without actually applying it to my buffer, only to the copied text?
I suggest using a CLI utility to put it on the clipboard: there are several I found previously, but here’s one:
So you’d do
or
the latter uses the X clipboard instead of the primary clipboard (assuming UNIX).
On windows, there are likely similar utilities
Edit
A pure vim solution would be:
Notes: