Summary: paste with P in visual mode.

It’s painful to paste over selected text in Vim, because the unnamed register is overwritten by the selected text. Thus, we can not paste the original yanked text twice.

If you have a file:

1
2
hello
kitty

You want to copy hello , paste it over kitty, and paste it again. You type these commands in Vim.

1
2
3
4
5
gg " move to the top
yy " copy current line
jV " move to the next line and select it
p  " paste over the select line
p  " paste again

You expect to get:

1
2
3
hello
hello
hello

However, you will get:

1
2
3
hello
hello
kitty

You should use P in visual mode, so the unnamed register is not changed. Put the original file content in Vim:

1
2
hello
kitty

Type ggyyjVPp, and you will get:

1
2
3
hello
hello
hello

You can read the help file by :h v_P for more information.