I often use vim
/ search command to verify my regular expressions (just to see what it matches). After that I usually use the
:%s replace command, where I use that regexp from search as a string to be replaced, e.g. I first look for such string:
It matches exactly what I want, so I do my replace:
But I have to write again entire regexp here. Usually that regexp is much longer, that's why I'm looking for solution:
Is there any existing shortcut or vim script for pasting that search pattern directly into replace command?
I use vim in terminal (no gvim).