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

Re: Highlighting :g//

Expand Messages
  • Gary Johnson
    ... Try Yakov Lerner s PP.vim script, ... Works great. Regards, Gary -- You received this message from the vim_use maillist. Do not top-post! Type your reply
    Message 1 of 6 , Apr 2, 2012
    • 0 Attachment
      On 2012-04-02, Paul wrote:
      > Often I'll want to see a list of lines that contain a pattern.
      > I'll do ':g/pattern/', sometimes followed by # if I want the line
      > numbers. Sometimes I'd like to see where in the line the pattern
      > matched, so, is there a way to have the output of :g// highlight
      > the pattern?

      Try Yakov Lerner's PP.vim script,
      http://vim.wikia.com/wiki/VimTip1141. Use it like this:

      :g/pattern/PP

      Works great.

      Regards,
      Gary

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Thilo Six
      Hello Paul, ... I recently did the same. What i used was vimgrep, e.g.: vimgrep /pat1 |pat2/ % | botright copen: The copen part opens up the so called quickfix
      Message 2 of 6 , Apr 2, 2012
      • 0 Attachment
        Hello Paul,


        Excerpt from Paul:
        > Often I'll want to see a list of lines that contain a pattern. I'll do
        > ':g/pattern/', sometimes followed by # if I want the line numbers. Sometimes
        > I'd like to see where in the line the pattern matched, so, is there a way to
        > have the output of :g// highlight the pattern?

        I recently did the same. What i used was vimgrep, e.g.:
        vimgrep /pat1\|pat2/ % | botright copen:

        The copen part opens up the so called quickfix window. With that you can
        breezingly jump from hit to an other AND get a nice overview of each line that
        has a match at the same time.
        Add a mapping for ':cnext' ':cprev' (aka next and previos match) and you can
        move through the list.

        --
        Regards,
        Thilo

        4096R/0xC70B1A8F
        721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Thilo Six
        Hello ... ^- copy and paste error, no colon there ... -- Regards, Thilo 4096R/0xC70B1A8F 721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F -- You received
        Message 3 of 6 , Apr 2, 2012
        • 0 Attachment
          Hello


          Excerpt from Thilo Six:

          > Hello Paul,
          >
          >
          > Excerpt from Paul:
          >> Often I'll want to see a list of lines that contain a pattern. I'll do
          >> ':g/pattern/', sometimes followed by # if I want the line numbers. Sometimes
          >> I'd like to see where in the line the pattern matched, so, is there a way to
          >> have the output of :g// highlight the pattern?
          >
          > I recently did the same. What i used was vimgrep, e.g.:
          > vimgrep /pat1\|pat2/ % | botright copen:
          ^- copy and paste error, no colon there
          >
          > The copen part opens up the so called quickfix window. With that you can
          > breezingly jump from hit to an other AND get a nice overview of each line that
          > has a match at the same time.
          > Add a mapping for ':cnext' ':cprev' (aka next and previos match) and you can
          > move through the list.
          >

          --
          Regards,
          Thilo

          4096R/0xC70B1A8F
          721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Paul
          ... Indeed it does, thanks. -- . -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to.
          Message 4 of 6 , Apr 3, 2012
          • 0 Attachment
            On Monday, 02 April, 2012 at 16:54:22 BST, Gary Johnson wrote:
            >> Often I'll want to see a list of lines that contain a pattern.
            >> I'll do ':g/pattern/', sometimes followed by # if I want the line
            >> numbers. Sometimes I'd like to see where in the line the pattern
            >> matched, so, is there a way to have the output of :g// highlight
            >> the pattern?
            >
            >Try Yakov Lerner's PP.vim script,
            >http://vim.wikia.com/wiki/VimTip1141. Use it like this:
            >
            > :g/pattern/PP
            >
            >Works great.

            Indeed it does, thanks.

            --

            .

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.