Link to home
Start Free TrialLog in
Avatar of Thaidog
ThaidogFlag for United States of America

asked on

What is the vim command equiv to: sed -i 's/something/something_else/g'

When inside vim, what is the ex command equiv to: sed -i 's/something/something_else/g'
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You could also replace the "1,$" with a single "%"

:%s/something/somthing_else/g
@serialband - That is exactly what farzanj suggested in http:#a38308745 - please read earlier comments :)
I did read the earlier comment.  I added a different syntax which reduces 2 keystrokes that did the same thing.  If you need to search& replace a lot of text, fewer keystrokes are better, at least it is for me.
gerwinjansen is right.  I don't see any two character difference:)
Maybe your fonts show the percent sign too large so you see it as 3 characters?  :P  O/o