Tip61: Replace a Visual Selection with a Register
January 12, 2021 ยท View on GitHub

When we use the p command in Visual mode, Vim replace the selection with the contents of the specified register.

Swap Two Words

deto cut the word "chips", copying it into the unnamed register. Then we visually select the word fish, which we want to replace.pput the word "chips" into the document, and the word "fish" is copied into the unnamed register. Then we snap back to the gap and paste the word "fish" from the unnamed register back into the document.
Note: m{char}command sets a mark, and the `{char} command jumps to the mark.