I want to replace old by new string by using call:Rep(new,old) . So my pseudo code is like this…
I am new to vimscript , I don’t know how to do it.
function! Rep(old,new)
!sed -i.bak 's/#{old}/#{new}/g' *
endfunction
Do you have any idea?
Thanks.
Change your function to
then use
:call Rep(old,new). You can also create a command for it.so that you can do
:Rep old new.