I’ve got multiple commands in a command line that builds a text string in the unnamed register @”. Then I have a substitute that captures a couple of atoms. Finally, I need to replace a pattern with the two submatches (\1 and \2) AND the @”.
I cannot get the @” reg to display its contents AFTER first displaying the submatches. I can display the @” prior to displaying the submatches. For ex:
multi-commands | @"=textString | 'a,'bs/(atom1)(atom2)/\1\2 "displays perfectly
Or,
multi-commands | @"=textString | 'a,'bs/(atom1)(atom2)/\=@" "displays 'textString' perfectly
But,
multi-commands | @"=textString | 'a,'bs/(atom1)(atom2)/\1\2@"
multi-commands | @"=textString | 'a,'bs/(atom1)(atom2)/\1\2\@"
multi-commands | @"=textString | 'a,'bs/(atom1)(atom2)/\1\2\=@"
All fail to display the register contents of ‘textString’ and instead show ‘@”‘
Does anyone know why that is?
That’s because of
\=needs to be first item in a replacement.You should use the following: