I know that by typing the following: :%s/iwanthis/replacedbythis/g will change all the matching words of the file. How can I do the same for all the files within a folder?
(actually replacing a lot of words like this: padding-bottom:5px;)
Open Vim with all the files loaded into buffers, and do the replace on all buffers at once with bufdo:
% vim *
... when vim has loaded:
:bufdo %s/iwanthis/replacedbythis/g | w
The | w
will write each file back to disk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With