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

Re: Howto :vimgrep over :argdo, please? :-)

Expand Messages
  • Bram Moolenaar
    ... It works fine for me. What is the problem you ran into? -- In a world without fences, who needs Gates and Windows? /// Bram Moolenaar --
    Message 1 of 8 , Aug 31, 2005
    • 0 Attachment
      Mikolaj Machowski wrote:

      > Dnia wtorek, 30 sierpnia 2005 17:53, François Pinard napisa³:
      > > Hi, gang. Could someone enlighten me?
      > >
      > > I much like the new `:vim' command under Vim7, but notice that I
      > > frequently need to use it over the list of argument files (those files
      > > `:argdo` is operating upon), and find it a bit cumbersome having to
      > > repeat the argument list over and over on the various `:vim' commands.
      > >
      > > Is there a way of, somehow, combining these commands? Or am I missing
      > > something evident?
      > >
      > > Thanks in advance for insights you might provide.
      >
      > According to docs something like::
      >
      > :argdo vimgrepadd! pattern %
      >
      > Should work. Bot does not :(

      It works fine for me. What is the problem you ran into?

      --
      In a world without fences, who needs Gates and Windows?

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
    • Mikolaj Machowski
      ... Open bunch of tex files in directory with:: vim *.tex ... In some of those files attri string is present, in some not. In result I get list in form::
      Message 2 of 8 , Aug 31, 2005
      • 0 Attachment
        Dnia środa, 31 sierpnia 2005 10:44, Bram Moolenaar napisał:
        > Mikolaj Machowski wrote:
        > > Dnia wtorek, 30 sierpnia 2005 17:53, François Pinard napisa?:
        > > > Hi, gang. Could someone enlighten me?
        > > >
        > > > I much like the new `:vim' command under Vim7, but notice that I
        > > > frequently need to use it over the list of argument files (those
        > > > files `:argdo` is operating upon), and find it a bit cumbersome
        > > > having to repeat the argument list over and over on the various
        > > > `:vim' commands.
        > > >
        > > > Is there a way of, somehow, combining these commands? Or am I
        > > > missing something evident?
        > > >
        > > > Thanks in advance for insights you might provide.
        > >
        > > According to docs something like::
        > > :argdo vimgrepadd! pattern %
        > >
        > > Should work. Bot does not :(
        >
        > It works fine for me. What is the problem you ran into?

        Open bunch of tex files in directory with::

        vim *.tex

        Then try::

        :clist (error list is empty)
        :argdo vimgrepadd! attri %

        In some of those files "attri" string is present, in some not.
        In result I get list in form::

        attrib.tex|31 col 14| \newcommand{\attribution}[1]
        {\raggedleft\textit{#1}}
        attrib.tex|51 col 3| \attribution{-- Anne Elk (Miss)
        attrib.tex|31 col 14| \newcommand{\attribution}[1]
        {\raggedleft\textit{#1}}
        attrib.tex|51 col 3| \attribution{-- Anne Elk (Miss)
        attrib.tex|31 col 14| \newcommand{\attribution}[1]
        {\raggedleft\textit{#1}}
        attrib.tex|51 col 3| \attribution{-- Anne Elk (Miss)

        With "old style" command::

        argdo grepadd! attri %

        I am getting (list of errors was empty)::

        attrib.tex|31| \newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        attrib.tex|51| \attribution{-- Anne Elk (Miss)
        attrib.tex|31| \newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        attrib.tex|51| \attribution{-- Anne Elk (Miss)
        attrib.tex|31| \newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        attrib.tex|51| \attribution{-- Anne Elk (Miss)
        quality.tex|85| redistribute, reattribute, sell, buy, rent, lease,
        quality.tex|295| about credits but just for ensuring that the class
        attribute
        quality.tex|85| redistribute, reattribute, sell, buy, rent, lease,
        quality.tex|295| about credits but just for ensuring that the class
        attribute
        item.tex|31| \newcommand{\attribution}[1]{\raggedleft\textit{#1}}

        'grepprg' is default "grep -n $* /dev/null".

        Doing grep (2.5.1) from command line::

        :r!grep -n attri *.tex

        attrib.tex:31:\newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        attrib.tex:51: \attribution{-- Anne Elk (Miss)
        item.tex:31:\newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        quality.tex:85: redistribute, reattribute, sell, buy, rent, lease,
        quality.tex:295: about credits but just for ensuring that the class
        attribute
        qual.tex:84: redistribute, reattribute, sell, buy, rent, lease,
        qual.tex:290: about credits but just for ensuring that the class
        attribute
        vst.tex:31:\newcommand{\attribution}[1]{\raggedleft\textit{#1}}
        vst.tex:1572:\hypertarget{lattribution}{}
        vst.tex:1590: \attribution{-- John Smith, Esq.

        m.
      • Bram Moolenaar
        ... That is not sufficient to reproduce the problem. You don t even say what the problem is. I guess you only get matches in one file, three times. Perhaps
        Message 3 of 8 , Aug 31, 2005
        • 0 Attachment
          Mikolaj Machowski wrote:

          > Dnia środa, 31 sierpnia 2005 10:44, Bram Moolenaar napisał:
          > > Mikolaj Machowski wrote:
          > > > Dnia wtorek, 30 sierpnia 2005 17:53, François Pinard napisa?:
          > > > > Hi, gang. Could someone enlighten me?
          > > > >
          > > > > I much like the new `:vim' command under Vim7, but notice that I
          > > > > frequently need to use it over the list of argument files (those
          > > > > files `:argdo` is operating upon), and find it a bit cumbersome
          > > > > having to repeat the argument list over and over on the various
          > > > > `:vim' commands.
          > > > >
          > > > > Is there a way of, somehow, combining these commands? Or am I
          > > > > missing something evident?
          > > > >
          > > > > Thanks in advance for insights you might provide.
          > > >
          > > > According to docs something like::
          > > > :argdo vimgrepadd! pattern %
          > > >
          > > > Should work. Bot does not :(
          > >
          > > It works fine for me. What is the problem you ran into?
          >
          > Open bunch of tex files in directory with::
          >
          > vim *.tex
          >
          > Then try::
          >
          > :clist (error list is empty)
          > :argdo vimgrepadd! attri %
          >
          > In some of those files "attri" string is present, in some not.
          > In result I get list in form::

          That is not sufficient to reproduce the problem. You don't even say
          what the problem is. I guess you only get matches in one file, three
          times. Perhaps you have autocommands that get in the way? Try setting
          'verbose' to find out what happens. Or start with "vim -u NONE".

          --
          hundred-and-one symptoms of being an internet addict:
          135. You cut classes or miss work so you can stay home and browse the web.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
        • Mikolaj Machowski
          ... NONE showed where problem is. m.
          Message 4 of 8 , Aug 31, 2005
          • 0 Attachment
            > That is not sufficient to reproduce the problem. You don't even say
            > what the problem is. I guess you only get matches in one file, three
            > times. Perhaps you have autocommands that get in the way? Try setting
            > 'verbose' to find out what happens. Or start with "vim -u NONE".

            NONE showed where problem is.

            m.
          Your message has been successfully submitted and would be delivered to recipients shortly.