How do you use registers to exchange two pieces of text?
"adiw then move, "aP and diw
Delete the first word into register a with "adiw, move to the second word, paste register a before with "aP, then delete the remaining original.
"adiw then move, "aP and diw
Delete the first word into register a with "adiw, move to the second word, paste register a before with "aP, then delete the remaining original.
cx{motion}
The vim-exchange plugin by Tom McDonald provides the cx operator to swap two arbitrary text regions.
plugins #plugins #exchange #editing #text-objects #refactoring