In vim, when highlighting and replacing individual words, I use:
Then, I go to the next word and type:
The default behavior is to immediately replace the yanked word with the replaced word. I figured this was advantageous, somehow, otherwise it would not have been implemented this way...and sure enough, after using it for a while, I like it.
However, after using it for a while, I have the memory for a mini stack: two words, the latest word in the register, and the previously yanked word.
How, in vim, would I implement a functionality where:
starting text: "hello world something" viwyw ("hello" is yanked, cursor is at start of "world") viwpw ("world" is replaced with hello, "world" is now yanked, cursor is at "something") and: tviwp (where 't' toggles or swaps the last two items yanked, and "something" is replaced by "hello") resulting text: "hello hello hello"
And I do not lose the default behavior, so that I can still do this:
hello world ^ cursor location viwywviwpbviwp result: world hello