Yank entire file

Chad Birch picture Chad Birch · May 6, 2009 · Viewed 78k times · Source

I often write something in gVim, then need to copy-paste it into another application.

Is there an easy way to yank the entire file? I usually do something like this

ggVG"+y

(Go to top, visual-line mode, go to bottom, yank)

But is there a better way that I'm missing out on?

Answer

Luc Hermitte picture Luc Hermitte · May 6, 2009

I use the following instruction: :%y+