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

Exclude pattern in global command

Expand Messages
  • Jostein Berntsen
    I would like to search all lines with -- in a file, but exclude all these lines with (X) in them. Is this possible to do with the global command? Is it
    Message 1 of 6 , Mar 5, 2012
    • 0 Attachment
      I would like to search all lines with "-->" in a file, but exclude all
      these lines with "(X)" in them. Is this possible to do with the global
      command? Is it also possible to give a command to global that makes it go to
      the end of the output list?


      Jostein


      --
      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
    • Tim Chase
      ... / %(.*-- .* &^ %( %((X) ) @!. )*$ ) Using Dr. Chip s LogiPat.vim[1] makes generating these monstrosities pretty straightforward. ... Just as in a buffer
      Message 2 of 6 , Mar 5, 2012
      • 0 Attachment
        On 03/05/12 05:42, Jostein Berntsen wrote:
        > I would like to search all lines with "-->" in a file, but exclude all
        > these lines with "(X)" in them. Is this possible to do with the global
        > command?

        /\%(.*-->.*\&^\%(\%((X)\)\@!.\)*$\)

        Using Dr. Chip's LogiPat.vim[1] makes generating these
        monstrosities pretty straightforward.

        > Is it also possible to give a command to global that makes it go to
        > the end of the output list?

        Just as in a buffer "G" seems to take me to the last line of output.

        -tim

        [1]
        http://www.vim.org/scripts/script.php?script_id=1290


        --
        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
      • Jostein Berntsen
        ... Thanks, this seems to work for search, but what I would like to dois to get the output to the global quicklist. ... In the global quicklist G seems to
        Message 3 of 6 , Mar 5, 2012
        • 0 Attachment
          On 05.03.12,05:57, Tim Chase wrote:
          > On 03/05/12 05:42, Jostein Berntsen wrote:
          > >I would like to search all lines with "-->" in a file, but exclude all
          > >these lines with "(X)" in them. Is this possible to do with the global
          > >command?
          >
          > /\%(.*-->.*\&^\%(\%((X)\)\@!.\)*$\)
          >
          > Using Dr. Chip's LogiPat.vim[1] makes generating these monstrosities
          > pretty straightforward.

          Thanks, this seems to work for search, but what I would like to dois to get the
          output to the global quicklist.

          > >Is it also possible to give a command to global that makes it go to
          > >the end of the output list?
          >
          > Just as in a buffer "G" seems to take me to the last line of output.
          >

          In the global quicklist "G" seems to exit the list.


          Jostein

          --
          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
        • Phil Dobbin
          ... Hash: SHA1 ... On a somewhat related note, I tried installing Dr. Chip s above script & it didn t play nicely. It had the effect of bleaching out the
          Message 4 of 6 , Mar 5, 2012
          • 0 Attachment
            -----BEGIN PGP SIGNED MESSAGE-----
            Hash: SHA1

            On 05/03/2012 11:57, Tim Chase wrote:


            > On 03/05/12 05:42, Jostein Berntsen wrote:
            >> I would like to search all lines with "-->" in a file, but exclude all
            >> these lines with "(X)" in them. Is this possible to do with the global
            >> command?
            >
            > /\%(.*-->.*\&^\%(\%((X)\)\@!.\)*$\)
            >
            > Using Dr. Chip's LogiPat.vim[1] makes generating these monstrosities
            > pretty straightforward.
            >
            >> Is it also possible to give a command to global that makes it go to
            >> the end of the output list?
            >
            > Just as in a buffer "G" seems to take me to the last line of output.
            >
            > -tim
            >
            > [1]
            > http://www.vim.org/scripts/script.php?script_id=1290


            On a somewhat related note, I tried installing Dr. Chip's above script &
            it didn't play nicely. It had the effect of "bleaching" out the
            appearance of the NERDTree so I pulled it from ~/.vim/plugin.

            If Charles would like me to debug what is clashing with my $VIMRUNTIME
            I'd be more than happy to.

            Cheers,

            Phil...

            - --
            But masters, remember that I am an ass.
            Though it be not written down,
            yet forget not that I am an ass.

            Wm. Shakespeare - Much Ado About Nothing


            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
            Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
            Comment: GPGTools - http://gpgtools.org
            Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

            iQEcBAEBAgAGBQJPVMdbAAoJEKpMeDHWT5ADoiAH/0N7DXyWdz9HDuXXsTLXizHA
            +k7C6pL+hBJqSzuHPW8BNOy/W3fwt1XvGeu1vkdSwu6oG1GIOqfzpqqYWfS6k/gu
            ieTmlHKRUFIvQVf8pzKdUG6v1tZ5oPYlMCueVckPM8KRK3uMKXxyUh9wCMok9rWM
            TjdX066c1+T16kjil4tPk/tikN7zA1D/GVUXAF+O7WppTVPl4P8L3T3y6rXsoVT6
            CQpa9L9QsyzSQ6sKu3wSZcf66S8Y6Atzt8mi5hsOfXK9LWIDpn1o7I4vMeoyqQdT
            gs9//jba6gyFvuuvxyGTA1p8RxeaWEuzmF9SYayjgwtdGcHcq3ccJAgroc0I9v8=
            =dUHm
            -----END PGP SIGNATURE-----

            --
            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
          • Ben Fritz
            ... Then, you ought to have asked for getting it in quickfix. What you said was search , so we gave you search. You can use the same pattern with the :vimgrep
            Message 5 of 6 , Mar 5, 2012
            • 0 Attachment
              On Mar 5, 6:10 am, Jostein Berntsen <jber...@...> wrote:
              > On 05.03.12,05:57, Tim Chase wrote:
              >
              > > On 03/05/12 05:42, Jostein Berntsen wrote:
              > > >I would like to search all lines with "-->" in a file, but exclude all
              > > >these lines with "(X)" in them. Is this possible to do with the global
              > > >command?
              >
              > >  /\%(.*-->.*\&^\%(\%((X)\)\@!.\)*$\)
              >
              > > Using Dr. Chip's LogiPat.vim[1] makes generating these monstrosities
              > > pretty straightforward.
              >
              > Thanks, this seems to work for search, but what I would like to dois to get the
              > output to the global quicklist.
              >

              Then, you ought to have asked for getting it in quickfix. What you
              said was "search", so we gave you search.

              You can use the same pattern with the :vimgrep command to get the
              results in the quickfix list. See :help :vimgrep or
              http://vim.wikia.com/wiki/Find_in_files_within_Vim for details on
              using the command.

              > > >Is it also possible to give a command to global that makes it go to
              > > >the end of the output list?
              >
              > > Just as in a buffer "G" seems to take me to the last line of output.
              >
              > In the global quicklist "G" seems to exit the list.
              >

              This should not happen. Please give an exact sequence of commands you
              enter to bring up the quickfix list and make G exit the quickfix list.
              Then try it again with (g)vim -N -u NONE -i NONE; I suspect you have a
              plugin or mapping interfering here.

              --
              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
            • Jostein Berntsen
              ... vimgrep with cwindow works very well, thanks. Jostein -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the
              Message 6 of 6 , Mar 6, 2012
              • 0 Attachment
                On 05.03.12,07:43, Ben Fritz wrote:
                >
                >
                > On Mar 5, 6:10 am, Jostein Berntsen <jber...@...> wrote:
                > > On 05.03.12,05:57, Tim Chase wrote:
                > >
                > > > On 03/05/12 05:42, Jostein Berntsen wrote:
                > > > >I would like to search all lines with "-->" in a file, but exclude all
                > > > >these lines with "(X)" in them. Is this possible to do with the global
                > > > >command?
                > >
                > > >  /\%(.*-->.*\&^\%(\%((X)\)\@!.\)*$\)
                > >
                > > > Using Dr. Chip's LogiPat.vim[1] makes generating these monstrosities
                > > > pretty straightforward.
                > >
                > > Thanks, this seems to work for search, but what I would like to dois to get the
                > > output to the global quicklist.
                > >
                >
                > Then, you ought to have asked for getting it in quickfix. What you
                > said was "search", so we gave you search.
                >
                > You can use the same pattern with the :vimgrep command to get the
                > results in the quickfix list. See :help :vimgrep or
                > http://vim.wikia.com/wiki/Find_in_files_within_Vim for details on
                > using the command.
                >

                vimgrep with cwindow works very well, thanks.


                Jostein

                --
                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.