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

":global" results in quickfix window

Expand Messages
  • Jean-Rene David
    I often use :g/foo/# to search for a pattern when I know it occurs many times in a file and I want to avoid using / followed by multiple n s to find a
    Message 1 of 4 , Feb 1, 2006
    • 0 Attachment
      I often use :g/foo/# to search for a pattern when I know
      it occurs many times in a file and I want to avoid
      using / followed by multiple "n"'s to find a
      specific match.

      Tip 1063
      (http://www.vim.org/tips/tip.php?tip_id=1063)
      shows how to save the output of :g to a file.
      Has anyone had this working by sending the output
      to the quickfix window?

      I mean if it's just a matter of finding the right
      'errorformat' I'll figure it out. I just want to
      know if someone's got it up and running already
      before I spend the time.

      --
      JR
    • Marian Csontos
      On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David ... Hi, with vim7 it so easy - simply use :vimgrep Regards, -- Marian ________
      Message 2 of 4 , Feb 1, 2006
      • 0 Attachment
        On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <jrdavid@...>
        wrote:

        > I often use :g/foo/# to search for a pattern when I know
        > it occurs many times in a file and I want to avoid
        > using / followed by multiple "n"'s to find a
        > specific match.
        >
        > Tip 1063
        > (http://www.vim.org/tips/tip.php?tip_id=1063)
        > shows how to save the output of :g to a file.
        > Has anyone had this working by sending the output
        > to the quickfix window?
        >
        > I mean if it's just a matter of finding the right
        > 'errorformat' I'll figure it out. I just want to
        > know if someone's got it up and running already
        > before I spend the time.
        >

        Hi, with vim7 it so easy - simply use :vimgrep

        Regards,

        -- Marian



        ________ Information from NOD32 ________
        This message was checked by NOD32 Antivirus System for Linux Mail Server.
        part000.txt - is OK
        http://www.nod32.com
      • Yegappan Lakshmanan
        Hi, ... In Vim7, you can also use the new :caddexpr command to add the results to the quickfix window: g/ /caddexpr expand( % ) . : . line( . ) .
        Message 3 of 4 , Feb 1, 2006
        • 0 Attachment
          Hi,

          On 2/1/06, Marian Csontos <csontos@...> wrote:
          > On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <jrdavid@...>
          > wrote:
          >
          > > I often use :g/foo/# to search for a pattern when I know
          > > it occurs many times in a file and I want to avoid
          > > using / followed by multiple "n"'s to find a
          > > specific match.
          > >
          > > Tip 1063
          > > (http://www.vim.org/tips/tip.php?tip_id=1063)
          > > shows how to save the output of :g to a file.
          > > Has anyone had this working by sending the output
          > > to the quickfix window?
          > >
          > > I mean if it's just a matter of finding the right
          > > 'errorformat' I'll figure it out. I just want to
          > > know if someone's got it up and running already
          > > before I spend the time.
          > >
          >
          > Hi, with vim7 it so easy - simply use :vimgrep
          >

          In Vim7, you can also use the new ":caddexpr" command
          to add the results to the quickfix window:

          g/<pattern>/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")

          - Yegappan
        • Hari Krishna Dara
          ... To the OP, if Vim7 is not an option, my greputils plugin will help you. Are you aware of the vim.org scripts section? If you do a search for grep you will
          Message 4 of 4 , Feb 1, 2006
          • 0 Attachment
            On Wed, 1 Feb 2006 at 3:16pm, Marian Csontos wrote:

            > On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <jrdavid@...>
            > wrote:
            >
            > > I often use :g/foo/# to search for a pattern when I know
            > > it occurs many times in a file and I want to avoid
            > > using / followed by multiple "n"'s to find a
            > > specific match.
            > >
            > > Tip 1063
            > > (http://www.vim.org/tips/tip.php?tip_id=1063)
            > > shows how to save the output of :g to a file.
            > > Has anyone had this working by sending the output
            > > to the quickfix window?
            > >
            > > I mean if it's just a matter of finding the right
            > > 'errorformat' I'll figure it out. I just want to
            > > know if someone's got it up and running already
            > > before I spend the time.
            > >
            >
            > Hi, with vim7 it so easy - simply use :vimgrep
            >
            > Regards,
            >
            > -- Marian

            To the OP, if Vim7 is not an option, my greputils plugin will help you.
            Are you aware of the vim.org scripts section? If you do a search for
            grep you will find this and other plugins.

            --
            HTH,
            Hari

            __________________________________________________
            Do You Yahoo!?
            Tired of spam? Yahoo! Mail has the best spam protection around
            http://mail.yahoo.com
          Your message has been successfully submitted and would be delivered to recipients shortly.