How do I copy text from vi?
Position the cursor where you want to begin copying.
Press v (or upper case V if you want to cut whole lines).
Move the cursor to the end of what you want to copy.
Press y.
Move to where you would like to paste.
Press P to paste before the cursor, or p to paste after.


Source: http://vim.wikia.com/wiki/Copy,_cut_and_paste