Marc Weber wrote:
How can I tell vim to not tread & and ~ in a special way when using
substitute?
compare
echo substitute(substitute('a','a','b','&'),'b','c &','')
and
echo substitute(substitute('a','a','b','&'),'b',substitute('c &','\V\(&\|~\)','\\\1','g'),'')
using substitute works but seems to be more ugly when used in scripts?
Marc
Under ":help substitute()" it is mentioned that the "flags" argument (the 4th
and last) should be either 'g' or the null string. Here you're using '&' in
the inner substitute.
Best regards,
Tony.