Copy command from vi to clipboard

view story

http://askubuntu.com – What is the command to copy all the contents to the system clipboard from a file open in an instance of the vi editor on a remote server, accessed via SSH. Also, what is the shortcut for pasting from system clipboard to vi. (HowTos)