Classical replace command looks like
%s/old_pattern/new_pattern which is fine, but working with code or constructing complex search regular expression is not the best option. I'd like to present my own solution and looking for better options.
My current workflow looks like:
Search for word using
Replace first occurrence using
:s//new_patternthis works because empty search pattern in this command will use content of the search register
"/which contains the last search pattern in our case
Apply replace to all buffer using
g&which is a shortcut to the
Suggestions are welcome.