DEV Community

Jonas Schumacher
Jonas Schumacher

Posted on

2

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)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay