3

I have a 500 lines txt file opened in VI, i want to copy the whole file from VI and paste it in the notepad

I have tried yanking the whole document, but i dont know how to paste it in the notepad

Viswanath
  • 51
  • 1
  • 3
  • 7
  • Yanking copies to vi's internal buffer, not the clipboard. see this answer http://stackoverflow.com/questions/11489428/how-to-make-vim-paste-from-and-copy-to-systems-clipboard – Colin Feb 22 '17 at 15:59

1 Answers1

3

If vi(m) has access to your system clipboard:

ggVG"+y

Go to the top of your file, enter visual mode, select to the end of file, then "+ means use the + register aka the system clipboard, and y yanks it.

Then again, if you just want the text in Notepad, why not save it as a text file and then open it in Notepad?

Wayne Werner
  • 49,299
  • 29
  • 200
  • 290