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

Re: How to "filter" a plaintext pattern in a separate fullpage buffer to work on it separately ?

Expand Messages
  • tjg
    Thanks for your answer. In fact I simply want to suppress errors manually, so, no need for automation, nor AI. All I wish is to have the possibility : - to
    Message 1 of 12 , Nov 1, 2012
    • 0 Attachment
      Thanks for your answer.

      In fact I simply want to suppress errors manually, so, no need for
      automation, nor AI.
      All I wish is to have the possibility :
      - to "filter" the relevant lines into a full-page buffer (and not a window
      at the bottom of the screen)
      - ... as if all the other lines had disappeared
      - where I can see them with their highlighting preserved
      - where I can modify them efficiently by concentrating on one pattern at a
      time
      - and then go back to the file and find the lines as modified by me in the
      "filtering buffer".

      Thanks again



      --
      View this message in context: http://vim.1045645.n5.nabble.com/How-to-filter-a-plaintext-pattern-in-a-separate-fullpage-buffer-to-work-on-it-separately-tp5711655p5711658.html
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      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
      ... OK, so you don t want to actually get a new scratch buffer. Try :tab split followed by this: http://vim.wikia.com/wiki/Folding_with_Regular_Expression --
      Message 2 of 12 , Nov 1, 2012
      • 0 Attachment
        On Thursday, November 1, 2012 12:02:18 PM UTC-5, tjg wrote:
        > Thanks for your answer.
        >
        >
        >
        > In fact I simply want to suppress errors manually, so, no need for
        >
        > automation, nor AI.
        >
        > All I wish is to have the possibility :
        >
        > - to "filter" the relevant lines into a full-page buffer (and not a window
        >
        > at the bottom of the screen)
        >
        > - ... as if all the other lines had disappeared
        >
        > - where I can see them with their highlighting preserved
        >
        > - where I can modify them efficiently by concentrating on one pattern at a
        >
        > time
        >
        > - and then go back to the file and find the lines as modified by me in the
        >
        > "filtering buffer".
        >
        >

        OK, so you don't want to actually get a new scratch buffer.

        Try :tab split followed by this:

        http://vim.wikia.com/wiki/Folding_with_Regular_Expression

        --
        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
      • tjg
        Thank you very much for your answer. One question, nevertheless : I have already set my fold method to an expression found in the Vim documentation : ... Is it
        Message 3 of 12 , Nov 1, 2012
        • 0 Attachment
          Thank you very much for your answer.

          One question, nevertheless : I have already set my fold method to an
          expression found in the Vim documentation :

          /This will make a fold out of paragraphs separated by blank lines:
          :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1/

          Is it possible to have 1 fold method (expression) and 2 expressions for 2
          different situations, and in that case, a usual expression (folding on
          paragraphs) plus an expression specific to a tab split ?

          Thanks again



          --
          View this message in context: http://vim.1045645.n5.nabble.com/How-to-filter-a-plaintext-pattern-in-a-separate-fullpage-buffer-to-work-on-it-separately-tp5711655p5711660.html
          Sent from the Vim - General mailing list archive at Nabble.com.

          --
          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
        • sc
          ... this isn t exactly what you are asking for, but it s close, and I feel may be of use to some, possibly yourself. I ve had fun with a folding tool:
          Message 4 of 12 , Nov 1, 2012
          • 0 Attachment
            On Thu, Nov 01, 2012 at 10:01:43AM -0700, tjg wrote:
            > Thanks for your answer.

            > In fact I simply want to suppress errors manually, so, no need for
            > automation, nor AI.
            > All I wish is to have the possibility :
            > - to "filter" the relevant lines into a full-page buffer (and not a window
            > at the bottom of the screen)
            > - ... as if all the other lines had disappeared
            > - where I can see them with their highlighting preserved
            > - where I can modify them efficiently by concentrating on one pattern at a
            > time
            > - and then go back to the file and find the lines as modified by me in the
            > "filtering buffer".

            this isn't exactly what you are asking for, but it's close, and I feel
            may be of use to some, possibly yourself. I've had fun with a folding
            tool:

            nnoremap <silent> <Leader>o :setlocal foldexpr=(getline(v:lnum)=~@/)?0:(getline(v:lnum-1)=~@/)\\|\\|(getline(v:lnum+1)=~@/)?1:2 foldmethod=expr foldlevel=0 foldcolumn=2<CR>
            nnoremap <silent> <Leader>oo :call UnsetFolds()<CR>

            the first mapping of <Leader>o is supposed to be all one line

            UnsetFolds is defined as

            function! UnsetFolds()
            setlocal foldexpr=0
            setlocal foldcolumn=0
            endfunction

            with these mappings, after any search if I hit <Leader>o I get every
            line that doesn't have my search pattern folded away into oblivion and
            only lines with my search pattern are visible (and easy to work with).
            My mnemonic when working with these mappings is to think "only."

            <Leader>oo then unfolds all

            hth,

            sc

            --
            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
            ... Yes. The foldexpr option is local to the Window. So you can do whatever you want in a split window/tab without affecting the first window/tab. Just be
            Message 5 of 12 , Nov 1, 2012
            • 0 Attachment
              On Thursday, November 1, 2012 1:54:56 PM UTC-5, tjg wrote:
              > Thank you very much for your answer.
              >
              >
              >
              > One question, nevertheless : I have already set my fold method to an
              >
              > expression found in the Vim documentation :
              >
              >
              >
              > /This will make a fold out of paragraphs separated by blank lines:
              >
              > :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1/
              >
              >
              >
              > Is it possible to have 1 fold method (expression) and 2 expressions for 2
              >
              > different situations, and in that case, a usual expression (folding on
              >
              > paragraphs) plus an expression specific to a tab split ?
              >

              Yes. The 'foldexpr' option is local to the Window. So you can do whatever you want in a split window/tab without affecting the first window/tab. Just be sure to use :setlocal and not :set.

              --
              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
            • tjg
              Thank you for your answer. If I understand well, I must - first search a pattern, e.g. /Robert - then apply your local expression fold method, here o
              Message 6 of 12 , Nov 1, 2012
              • 0 Attachment
                Thank you for your answer.

                If I understand well, I must

                - first search a pattern, e.g. /Robert
                - then apply your local expression fold method, here <leader>o

                Am I right ?

                Thanks again



                --
                View this message in context: http://vim.1045645.n5.nabble.com/How-to-filter-a-plaintext-pattern-in-a-separate-fullpage-buffer-to-work-on-it-separately-tp5711655p5711663.html
                Sent from the Vim - General mailing list archive at Nabble.com.

                --
                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
              • tjg
                @Ben Fritz This is very clear Thank you -- View this message in context:
                Message 7 of 12 , Nov 1, 2012
                • 0 Attachment
                  @Ben Fritz

                  This is very clear
                  Thank you



                  --
                  View this message in context: http://vim.1045645.n5.nabble.com/How-to-filter-a-plaintext-pattern-in-a-separate-fullpage-buffer-to-work-on-it-separately-tp5711655p5711664.html
                  Sent from the Vim - General mailing list archive at Nabble.com.

                  --
                  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
                • sc
                  ... yes, that s it exactly -- it s very useful when done you can restore normality via oo -- You received this message from the vim_use maillist. Do
                  Message 8 of 12 , Nov 2, 2012
                  • 0 Attachment
                    On Thu, Nov 01, 2012 at 01:53:47PM -0700, tjg wrote:
                    > Thank you for your answer.

                    > If I understand well, I must

                    > - first search a pattern, e.g. /Robert
                    > - then apply your local expression fold method, here <leader>o

                    > Am I right ?

                    yes, that's it exactly -- it's very useful

                    when done you can restore normality via <Leader>oo

                    --
                    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
                  • stosss
                    ... Trying to learn. Okay what is or All I found when I ran :h leader was these *g:html_map_leader *g:html_map_entity_leader Thanks -- You
                    Message 9 of 12 , Nov 2, 2012
                    • 0 Attachment
                      On Fri, Nov 2, 2012 at 6:20 PM, sc <toothpik@...> wrote:
                      > On Thu, Nov 01, 2012 at 01:53:47PM -0700, tjg wrote:
                      >> Thank you for your answer.
                      >
                      >> If I understand well, I must
                      >
                      >> - first search a pattern, e.g. /Robert
                      >> - then apply your local expression fold method, here <leader>o
                      >
                      >> Am I right ?
                      >
                      > yes, that's it exactly -- it's very useful
                      >
                      > when done you can restore normality via <Leader>oo

                      Trying to learn.

                      Okay what is <Leader> or <leader>

                      All I found when I ran :h leader

                      was these

                      *g:html_map_leader
                      *g:html_map_entity_leader

                      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
                    • stosss
                      ... sorry found when I used :h -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
                      Message 10 of 12 , Nov 2, 2012
                      • 0 Attachment
                        >
                        > Trying to learn.
                        >
                        > Okay what is <Leader> or <leader>
                        >
                        > All I found when I ran :h leader
                        >
                        > was these
                        >
                        > *g:html_map_leader
                        > *g:html_map_entity_leader
                        >
                        sorry found <Leader> when I used :h <Leader>

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