Example: I have some text, like this php code
if(empty($condition)) {
// work here...
}
And my default register contains the string "$NewCondition".
I want to place the cursor inside the first set of parens (...) and perform a command that will result in this:
if($NewCondition) {
// work here...
}
So my question: Is there some way to replace the text inside the parens using the default register?
Most suggestions I've found, such as this one, fail when there's nested parens.
I also know I can name registers, such as "ayi( to yank all text in parens into register a, but I don't want to have to type two extra characters every time I'm yanking. That's why I'm asking about the default register.
In an ideal solution the default register would still contain "$NewCondition" when the replace is complete.