Search and replace in vim

I use vim all the time, but I can never remember off the top of my head. I have to look it up every time. So I’ve made a note of it here.

This command simply replaces all occurrences of string with replace. Simple!

:%s/search/replace/g

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s