Posts

Showing posts from June, 2018

Using Registers with the Substitution command

Image
Lately, I have found myself using more than the system clipboard for registers. Specifically for substitutions,  I will use this mapping: register s will be my source register t will be my target Here is an example: Then I just enter the substitution command and placing the contents of register s in the source section and the contents of register t in the target section. The "trick" is to press [Ctrl-R] when you are ready to paste the value of a register in the :s ex command. You will see a  double quote, ", as follows: Now, just enter the desired register, e.g. s for the source, s.  Also, just enter the desired register, e.g. t for the target: In this particular scenario, I have a specific (perhaps rote), substitution going on and there is no real need for a regular expression in the pattern section (aka in this context, the source). Certainly we could use various tools to facilitate an accurate, intentional substitution...