0

I need to perform a search and replace regex in vim of the style:

s/search/replace/g

However, I need to do this in reverse, from the bottom of the text to the beginning.

1 Answer 1

2

I have no idea why you would want to do that (and your question has a strong XY problem smell to it) but you could reverse your text, do a normal substitution and revert your text back to its original order:

:g/^/m0
:%s/search/replace/g
:g/^/m0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .