Mail Archives: djgpp/2000/03/14/19:08:20
Eli Zaretskii wrote:
>
> On Tue, 14 Mar 2000, leon wrote:
>
> > just have discovered a way to do a global search and replace (ie on
> > multiple files) in vim.
>
> Every decent editor has it.
>
> > It does however requiers the use of key mappings etc.
>
> Sorry, I don't understand this part.
>
> > Was just wondering - if there is some binutil with djgpp distribution
> > which will allow for multifile search and replace.
>
> I'm not sure I understand what are you trying to accomplish. Please
> post a real-life example.
say i have 50 source files and 50 header files - somewhere they use (in
one way or another) a method called "PostUserApplicationToSmile()" say
now i decide that the more useful name would be "Silly()" - i do not
want to open each file - i just want to use some utility which would go
through a specified directory and automatically search and replace the
needed text in all the files.
Example in vim (as i got from a newsgroup):
"
Go to the command prompt, and then to the directory containing
the files. do 'vim *.*' (w/o the quotes of course), then map a
key, say, z as ':map z :%s/hello/good by/g<C-v><C-m>:w<C-v><C-
m>:n<C-v><C-m>Z' along with the mapping ':map Z z'
"
notice that this example makes the use of key mappings AND opening of
files into editor - both are rather auxiliary to the intention of mine.
With best regards - Leon.
- Raw text -