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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -