Here's a minimal example of what I'm trying to do. Start with:
"this")
"that")
[hundreds of lines like this]
End with:
"this",&this)
"that",&that)
[hundreds of lines like this]
I have gotten this far:
g/"\p*"/s/)/[what to put here?]
So it correctly identifies the string that I want to copy. What I'm not sure is how to tell it that I want it to paste that string at the end. I've tried using &, but that matches the ), not the "\p*".
:%s/"\(.*\)")/"\1",\&\1)/– Stephane Chazelas Feb 5 at 22:32