Languages
[Edit]
EN

Vim replace all

1 points
Created by:
martineau
300

Quick solution:

:%s/what_to_replace/replace_with/g

Example - replace all version in file from 1.5.0 to 1.6.0:

:%s/1.5.0/1.6.0/g

 

When we want to replace all text in some lines:

:3,7s/what_to_replace/replace_with/g

It will replace only in lines from 3 to 7 - both included (inclusive).

 

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join