so if i have the following multiline text in my register +
:
ZERO
SIGN
CARRY
AUXILIARY
PARITY
OVERFLOW
INTERRUPT
DIRECTION
TRAP
And I have the following code:
case ZERO :
return a->FLAGS.derp;
case SIGN :
return a->FLAGS.derp;
case CARRY :
return a->FLAGS.derp;
case AUXILIARY:
return a->FLAGS.derp;
case PARITY :
return a->FLAGS.derp;
case OVERFLOW :
return a->FLAGS.derp;
case INTERRUPT:
return a->FLAGS.derp;
case DIRECTION:
return a->FLAGS.derp;
case TRAP :
return a->FLAGS.derp;
I want the result of a search and replace command (i.e. :%s\derp\register+
\g) to be
case ZERO :
return a->FLAGS.ZERO;
case SIGN :
return a->FLAGS.SIGN;
case CARRY :
return a->FLAGS.CARRY;
case AUXILIARY:
return a->FLAGS.AUXILIARY;
case PARITY :
return a->FLAGS.PARITY;
case OVERFLOW :
return a->FLAGS.OVERFLOW;
case INTERRUPT:
return a->FLAGS.INTERRUPT;
case DIRECTION:
return a->FLAGS.DIRECTION;
case TRAP :
return a->FLAGS.TRAP;
The command :%s/foo/\=@a/g
is very close to this but not close enough, it will insert the totality of the register on each match.