I can’t remember how to search and replace a string in Vim!

I’m not going to explain what all the options are, or tell you what each part of the command means. I’m just going to give you an example so that you can remember it. You can look up the details somewhere else.

This example will replace every instance of <find string> with <replace string> in the whole file.

%s$<find string>$<replace string>$g

[ 0 comments | 0 pingbacks | , ]
Add post to: Delicious Reddit Slashdot Digg Technorati Google
(already: 0) Comment post

Comments

No comments for this post

Email: Password:
OpenID URL:
Forgot Login? Close