Archive for the ‘vim’ tag

Today, I tried to find a convenient way to unify the spelling of a word used in various text files spread across multiple directories. Of course vim has a solution to this. In my case all files are of type *.txt. The term I want to search for is “re-use” which should be replaced by “reuse“. Here is what I did:

Open vim while loading all relevant files recursively as a argument list the editor. vim **/*.txt

Start recording a macro in register “a”. Type qa

Enter the substitution command to search and replace a specific character pattern :%s/re\-use/reuse/ge