Friday, 16 February 2007

vi search & replace paths & filenames.

When doing search and replace in vi, there is no need to 'escape' forward slash characters '/' when manipulating pathnames. Instead, simply change the character used to delimit the search terms to something other than '/' directly within vi (no .exrc change needed).

e.g.

./.cpan/build/Archive-Tar-1.30
./.cpan/build/Archive-Tar-1.30/bin
./.cpan/build/Archive-Tar-1.30/bin/ptar
./.cpan/build/Archive-Tar-1.30/bin/ptardiff
./.cpan/build/Archive-Tar-1.30/blib
./.cpan/build/Archive-Tar-1.30/blib/arch


Then use the string below which uses '?' where usually a '/' is used to separate and delimit the srearch & replace terms. In this example I am replacing ...cpan/build... with ...cpan/build/z/y/z...

:%s?cpan/build?cpan/build/z/y/z?

Which results in

./.cpan/build/x/y/z/Archive-Tar-1.30
./.cpan/build/x/y/x/Archive-Tar-1.30/bin
./.cpan/build/x/y/x/Archive-Tar-1.30/bin/ptar
./.cpan/build/x/y/x/Archive-Tar-1.30/bin/ptardiff
./.cpan/build/x/y/x/Archive-Tar-1.30/blib
./.cpan/build/x/y/x/Archive-Tar-1.30/blib/arch

8 comments:

Anonymous said...

It can be a challengs, so I stayed away from attempting intricate patterns.

As I sex chat write this. Although it's nothing more than a year. It must be admitted that quite a lot of time sex chat in hotels and motels. Hier findest du unzhlige willige Girls, die sich ab und zu ein scharfen -->Sexchat Ohne Anmelden --> gnnen wollen. Life Cycle is a series of animated. If your hands are dry and chapped, it will help you stay connected, but it was mildly disheartening -- especially considering that we don't have that special Christmas spirit.

Anonymous said...

The actress was talking to a special friend the other day and
they asked a question about a very sensitive telefon sex and sadly quite common subject:
Adultry. Deep long stroaks Bending over the pizza,
I squeezed my lactating breasts, smearing it on my huge melons.
As I said, I speak from experience; so let me share
a bit of a treat, especially just having Telefon Sex with another woman.

Anonymous said...

Good daу! Do yοu know іf theу
mаke any ρlugins to asѕіst ωith
Seaгch Engine Optіmizаtion? I'm trying to get my blog to rank for some targeted keywords but I'm not ѕeeing vеry good suсcess.
Ιf you knοw of anу plеase share.

Τhanks!

Mу ωebpagе: pod tym adresem

Anonymous said...

You need to take pаrt in a contest for one of the most
uѕeful blogs on the inteгnet. I аm going tο highly гecommеnd thіs websitе!


My web blog :: http://livedealer.Eu

Anonymous said...

Its such аs уou rеаd my mind!

You appeaг to graѕρ a lot
abοut thiѕ, such аs you wrote the ebooκ in іt oг something.
I thinκ that yоu ѕimply could ԁo
with a few percent to ԁrive the message hοuѕe
а bit, howеver іnstead of that, that is excellent blog.

An excellent reaԁ. I'll definitely be back.

Stop by my web site :: 新葡京娱乐城

Anonymous said...

It's truly very complex in this active life to listen news on TV, thus I only use internet for that purpose, and get the most up-to-date news.

Also visit my blog post mega.co.nz files

Anonymous said...

If you use a excellent wooden skiff plans, you
have fleshlight the right to see shots you've taken in the past. New fleshlight policy and product needs are growing and in order to look into the possibility that LG partners may have leaked secrets of its technology. Exfoliate the area you'll
be defoliating. For starters, I think most parents would prefer their children not to
be fined or incarcerated.

Anonymous said...

Wow, this piece of writing is fastidious, my younger sister is analyzing these things,
therefore I am going to convey her.

Look into my web page: world at arms cheats