In vi one can replace strings globally by the following command
:%s/strtoreplace/replacedstr/g
Is it possible to put this in .bashrc (through some function may be say vireplace() ), so that one can run the same command in terminal without opening the file. Also the strings (strtoreplace,replacedstr) should be prompt inputs ($@) so that it should work for any string one wants to replace with any another any string? I want something like
function vireplace() { vim :%s/$@/$@/g $@ ;}