DEV Community

Jonas Schumacher
Jonas Schumacher

Posted on

VIM Tip: Replace Without Yanking

You yanked a word and want to use it to replace more than one other word. The naive approach of selecting each of these other words and then hitting p doesn't really work though, does it?

This is because the first p yanks the highlighted word at the same time, replacing the original word in the register.

The solution is to paste from the 0th register directly:

"0p

That you can do however many times you like.

Top comments (0)