Is there a way to 'pipe' text from a register to an another register or set of registers? For example, move "q
to registers "1
through "5
.
I often wish to create slightly different versions of the same macro, so it is useful to be able to copy a 'template' macro to several registers and then modify each of them in place.
To give a practical example, here is the problem that prompted this question for me.
I need to turn the following line from a hardware description language into many repeated blocks,
RAM64(in=in, load=load0, address=address[0..5], out=out1);
to
RAM64(in=in, load=load1, address=address[0..5], out=out2);
RAM64(in=in, load=load2, address=address[0..5], out=out3);
RAM64(in=in, load=load3, address=address[0..5], out=out4);
RAM64(in=in, load=load4, address=address[0..5], out=out5);
I have a macro which performs this, using the increment function, yypW^At)^A
which I stored in register "a
.
Sometimes, I need the pattern of incrementing to be slightly different, such as
RAM512(in=in, load=load1, address=address[0..8], out=out2);
RAM512(in=in, load=load2, address=address[0..8], out=out4);
RAM512(in=in, load=load3, address=address[0..8], out=out6);
RAM512(in=in, load=load4, address=address[0..8], out=out8);
where the macro in register "b
would be yypW^At)^A^A
.
I want a register to do this, but for each increment from 1-5. The register "a
could (somehow) be copied to registers b through e. Then I would paste each register into the buffer, make the required modification (add more terms, change the character that follows the t
motion etc) and yank the modified expression back into the register. Ideally this last step could even be included in the command(s) to copy the registers
This saves me from repeating all of the characters in the macro that do NOT require changing. For my example it may be trivial, but I can foresee times when it might be very helpful to do what I am asking.