Loading ...
Sorry, an error occurred while loading the content.

RE: argdo and grep

Expand Messages
  • Hari Krishna Dara
    ... You will have to make sure hidden is set or tack on | w at the end. -- HTH, Hari ...
    Message 1 of 4 , Mar 1 8:07 AM
    • 0 Attachment
      On Thu, 1 Mar 2007 at 5:25pm, Naim Far wrote:

      > Thanx Yakov for your response,
      >
      > It would help, but I would rather to do it with in working in vim. I'm
      > editing an enormous number of files, and when I change a pattern, I want
      > to change it in the few files that has this pattern, and not having to
      > go through all the files.
      >
      > Is there anyway you could think of?!

      Try:

      :args `grep -l 'pattern' *` | argdo :%s/<pattern>/<new_pattern>/g

      You will have to make sure 'hidden' is set or tack on "| w" at the end.

      --
      HTH,
      Hari

      >
      > Thanx again...
      >
      > Naim
      >
      >
      > -----Original Message-----
      > From: Yakov Lerner [mailto:iler.ml@...]
      > Sent: Thursday, March 01, 2007 2:20 PM
      > To: Naim Far
      > Cc: vim@...
      > Subject: Re: argdo and grep
      >
      > On 3/1/07, Naim Far <naim@...> wrote:
      > > I was wondering about argdo! Is there anyway to do the following
      > > command
      > >
      > > :grep <pattern> * | argdo :%s/<pattern>/<new_pattern>/g
      >
      > How about this:
      > vim `grep -l 'pattern' *`
      > :argdo :%s/<pattern>/<new_pattern>/g
      >
      > Yakov
      >
      >



      ____________________________________________________________________________________
      8:00? 8:25? 8:40? Find a flick in no time
      with the Yahoo! Search movie showtime shortcut.
      http://tools.search.yahoo.com/shortcuts/#news
    Your message has been successfully submitted and would be delivered to recipients shortly.