I have gotten comfortable using expressions in Vim to do replaces across large files and would like to know what utility program to learn that will allow me to do such a thing across folders of files in a similar fashion.
What command line program for search and replace is most like vims and works across folders?
I have gotten comfortable using expressions in Vim to do replaces across large files
Share
will replace every
foowithbaron every line in every file in the current directory in place and creates a backup file with.bakextension.So I’d look into
sed. But… Vim is very capable:is almost the same.
bufdo!executes the following command (%s/foo/bar/gin this case => replace everyfoowithbaron every line (%is a special line address for every line)).wqameans: write all then quit. You can specify at most 10-cswitches to Vim, which will be executed in the specified order. So, basically this is Vim automation:The only difference is the lack of backup file creation (which can be achieved easily with some
.vimrcsettings). Butsedis faster.