Last Updated: February 25, 2016
·
938
· agit0

Yank a whole file in Vim.

Most people use

ggVG"y+

to yank the whole file which is highly inefficient.

A much faster way is to use

:%y+

You can easily map it for faster use:

map <Leader>y :%y+<cr>

Makes copying the whole file much faster!

2 Responses
Add your response

I would rather use <Leader>fy as <Leader>y is nicer to have binded to "+y.

over 1 year ago ·

Hm that's a nice idea actually

over 1 year ago ·