Indonesia Website Awards
Indonesia Website Awards

Hello everyone, For those of you who often do file editing with the Vim editor, and often have to replace word in vim editor, especially in a series of code / configuration / sentences with very long lines, of course it will be difficult if you have to find and edit one word at a time. you want to change right? there is actually an easy way to do it quickly, namely by typing commands

:%/[word u want to change]/[change to]/g

for practice, I will give an example. I have a file that contains something like this:

 

editor vim

 

Also Read  : Copy Paste in Vim Editor

Now, in short I want to change the word Excepteur with Lukems.com, let’s just type it

:%s/Excepteur/Lukems.com/g Then press ENTER

then all Excepteur words will be replaced with Lukems.com

 

editor vim

 

Yes, that’s the way to replace words in the vim editor, I hope this information is useful, Thank you ^^.

Categories: Linux

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *