I want to replace X with Y in vim with the regular expression ^+.*X$, which begin with + and end with X.
3 Answers
Yet another alternative, use the :g command to operate in lines beginning with + and replace the final X:
g/^+/s/X$/Y
Yet another alternative, use the :g command to operate in lines beginning with + and replace the final X:
g/^+/s/X$/Y