Must I escape every '\' to realize vim substitution of file path? -
this question has answer here:
i need substitute long path brief new pattern. feel escape every \
dumb idea, looks like:
:%s/\/my\/very\/very\/dumb\/long\/path\//new_pattern/gc
is there smarter way that?
must escape every '\' realize vim substitution of file path?
no, don't.
is there smarter way that?
yes. can use different character after %s
.
:%s+/my/very/very/dumb/long/path+new_pattern+gc
from :help :s
instead of
'/'
surrounds pattern , replacement string, can use other single-byte character, not alphanumeric character,'\'
,'"'
or'|'
. useful if want include'/'
in search pattern or replacement string. example:
:s+/+//+
Comments
Post a Comment