Is there a way to pipe selected text through an external command in vim, but not to replace the selected text with the output? Occasionally I want to copy something in a vim buffer to the X clipboard, so I use something like %!xclip
-- but then I have to "undo" that command to get the text back since xclip doesn't return anything. Short of writing a wrapper script around xclip that also echoes the text back, is there a better way to do this?
Thanks!
+
."+yy
copies current line to clipboard. You can also use visual selections.