Is there any way to copy all lines from open file to clipboard in VI editor. I tried yG but it\'s not using clipboard to store those lines.
So
on Mac
copy selected part: visually select text(type v or V in normal mode) and type :w !pbcopy
v
V
:w !pbcopy
copy the whole file :%w !pbcopy
:%w !pbcopy
past from the clipboard :r !pbpaste
:r !pbpaste