If I have this directory: /home/abc/def/apples/
and I want to replace it with this directory: /home/nfl/nfl/nba/ in vim,
what is the syntax? I tried using %s/a/b/g but this command fails.
If I have this directory: /home/abc/def/apples/
and I want to replace it with this directory: /home/nfl/nfl/nba/ in vim,
what is the syntax? I tried using %s/a/b/g but this command fails.
You can escape the / with a backslash (\):
:%s/\/path\/name/\/new\/path/g
This is usually okay if you have just one or two /s, but it quickly becomes very unwieldy. A better option is to use a different delimiter:
:%s!/path/name!/new/path!g