Esta entrada también está disponible en: Spanish
Many times I have seen the need to replace text with VIM. Here I leave the way to do.
First, we open the file to edit:
vim file
We press ESC and insert colon “:”. After that, we insert the instruction:
:1,$ s/search_text/replacement_text/g
The characters 1,$ indicate that should search from the first to the last line of the file. After, just replace “search_text” and “replacement_text” for that we need.