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

yank / delete / paste without output

Expand Messages
  • Óscar Pereira
    Hello, I have a vimscript function, in which I yank some content, modify it, and then paste it back. The function is called by a visual mode map. normal! gv xy
    Message 1 of 6 , Jul 18, 2013
    View Source
    • 0 Attachment
      Hello,

      I have a vimscript function, in which I yank some content, modify
      it, and then paste it back. The function is called by a visual mode
      map.

      normal! gv"xy
      "... modify the text ...
      normal! gvd
      normal! "xP

      It works fine, except for the warning "x more lines", which makes me
      press Enter needlessly. Is there any way to remove that warning?

      I've googled quite a bit for this, but the only thing that almost-
      kinda-works is to :set ch=2 (in the opened file), then trigger the
      map, then set the value back to 1. I've considered setting the
      status bar to two lines permanently, but before I do that, is there
      a better way? I also tried setting ch inside the function, and
      outside the function but inside the map, before calling the function
      proper -- neither worked.

      So, ideas anyone? Thanks in advance for your help.
      --Óscar

      --
      Óscar Pereira | https://erroneousthoughts.org

      Rules of Optimisation:
      Rule 1: Don't do it.
      Rule 2 (for experts only): Don't do it yet.
      -- M.A. Jackson
    • Gary Johnson
      ... Does setting report to a high value help? If so, you could save and restore it in your function, e.g., let l:report = &report set report=9999 Do it.
      Message 2 of 6 , Jul 18, 2013
      View Source
      • 0 Attachment
        On 2013-07-18, Óscar Pereira wrote:
        > Hello,
        >
        > I have a vimscript function, in which I yank some content, modify
        > it, and then paste it back. The function is called by a visual mode
        > map.
        >
        > normal! gv"xy
        > "... modify the text ...
        > normal! gvd
        > normal! "xP
        >
        > It works fine, except for the warning "x more lines", which makes me
        > press Enter needlessly. Is there any way to remove that warning?
        >
        > I've googled quite a bit for this, but the only thing that almost-
        > kinda-works is to :set ch=2 (in the opened file), then trigger the
        > map, then set the value back to 1. I've considered setting the
        > status bar to two lines permanently, but before I do that, is there
        > a better way? I also tried setting ch inside the function, and
        > outside the function but inside the map, before calling the function
        > proper -- neither worked.
        >
        > So, ideas anyone? Thanks in advance for your help.

        Does setting 'report' to a high value help? If so, you could save
        and restore it in your function, e.g.,

        let l:report = &report
        set report=9999
        " Do it.
        let &report = l:report

        HTH,
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Benji Fisher
        ... How about ... P.S. Is there a way to configure Gmail s web interface to make bottom-posting more convenient? -- HTH Benji Fisher -- -- You received this
        Message 3 of 6 , Jul 18, 2013
        View Source
        • 0 Attachment
          On Thu, Jul 18, 2013 at 3:04 PM, Gary Johnson <garyjohn@...> wrote:
          On 2013-07-18, Óscar Pereira wrote:
          >
          >   normal! gv"xy
          >   "... modify the text ...
          >   normal! gvd
          >   normal! "xP
          >
          > It works fine, except for the warning "x more lines", which makes me
          > press Enter needlessly. Is there any way to remove that warning?

          Does setting 'report' to a high value help?  If so, you could save
          and restore it in your function, e.g.,

              let l:report = &report
              set report=9999
              " Do it.
              let &report = l:report

               How about

          :silent normal! "xP
          :help :silent

          P.S. Is there a way to configure Gmail's web interface to make bottom-posting more convenient?

          -- 
          HTH
          Benji Fisher

          --
          --
          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
           
          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
           
           
        • Óscar Pereira
          Yes that worked! Many thanks! :D --Óscar ... -- Óscar Pereira | https://erroneousthoughts.org Rules of Optimisation: Rule 1: Don t do it. Rule 2 (for
          Message 4 of 6 , Jul 18, 2013
          View Source
          • 0 Attachment
            Yes that worked! Many thanks! :D

            --Óscar


            On Thu, Jul 18, 2013 at 12:04:18PM -0700, Gary Johnson wrote:
            > On 2013-07-18, Óscar Pereira wrote:
            > > Hello,
            > >
            > > I have a vimscript function, in which I yank some content, modify
            > > it, and then paste it back. The function is called by a visual mode
            > > map.
            > >
            > > normal! gv"xy
            > > "... modify the text ...
            > > normal! gvd
            > > normal! "xP
            > >
            > > It works fine, except for the warning "x more lines", which makes me
            > > press Enter needlessly. Is there any way to remove that warning?
            > >
            > > I've googled quite a bit for this, but the only thing that almost-
            > > kinda-works is to :set ch=2 (in the opened file), then trigger the
            > > map, then set the value back to 1. I've considered setting the
            > > status bar to two lines permanently, but before I do that, is there
            > > a better way? I also tried setting ch inside the function, and
            > > outside the function but inside the map, before calling the function
            > > proper -- neither worked.
            > >
            > > So, ideas anyone? Thanks in advance for your help.
            >
            > Does setting 'report' to a high value help? If so, you could save
            > and restore it in your function, e.g.,
            >
            > let l:report = &report
            > set report=9999
            > " Do it.
            > let &report = l:report
            >
            > HTH,
            > 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
            >
            > ---
            > You received this message because you are subscribed to the Google Groups "vim_use" group.
            > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            > For more options, visit https://groups.google.com/groups/opt_out.
            >
            >


            --
            Óscar Pereira | https://erroneousthoughts.org

            Rules of Optimisation:
            Rule 1: Don't do it.
            Rule 2 (for experts only): Don't do it yet.
            -- M.A. Jackson
          • Óscar Pereira
            ... I tried that -- it didn t work. But thanks for mentioning it anyway! ... I have no idea. ... -- Óscar Pereira | https://erroneousthoughts.org Rules of
            Message 5 of 6 , Jul 18, 2013
            View Source
            • 0 Attachment
              On Thu, Jul 18, 2013 at 03:22:33PM -0400, Benji Fisher wrote:
              > On Thu, Jul 18, 2013 at 3:04 PM, Gary Johnson <garyjohn@...> wrote:
              >
              > > On 2013-07-18, Óscar Pereira wrote:
              > > >
              > > > normal! gv"xy
              > > > "... modify the text ...
              > > > normal! gvd
              > > > normal! "xP
              > > >
              > > > It works fine, except for the warning "x more lines", which makes me
              > > > press Enter needlessly. Is there any way to remove that warning?
              > >
              > > Does setting 'report' to a high value help? If so, you could save
              > > and restore it in your function, e.g.,
              > >
              > > let l:report = &report
              > > set report=9999
              > > " Do it.
              > > let &report = l:report
              > >
              >
              > How about
              >
              > :silent normal! "xP
              > :help :silent

              I tried that -- it didn't work. But thanks for mentioning it anyway!

              >
              > P.S. Is there a way to configure Gmail's web interface to make
              > bottom-posting more convenient?

              I have no idea.

              >
              > --
              > HTH
              > Benji Fisher
              >
              > --
              > --
              > 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
              >
              > ---
              > You received this message because you are subscribed to the Google Groups "vim_use" group.
              > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              > For more options, visit https://groups.google.com/groups/opt_out.
              >
              >


              --
              Óscar Pereira | https://erroneousthoughts.org

              Rules of Optimisation:
              Rule 1: Don't do it.
              Rule 2 (for experts only): Don't do it yet.
              -- M.A. Jackson
            • Chris Lott
              ... Higlight what you want to quote before pressing Reply (or R ). c -- Chris Lott -- -- You received this message from the vim_use
              Message 6 of 6 , Jul 18, 2013
              View Source
              • 0 Attachment
                On Thu, Jul 18, 2013 at 11:22 AM, Benji Fisher <benji@...> wrote:
                > P.S. Is there a way to configure Gmail's web interface to make
                > bottom-posting more convenient?


                Higlight what you want to quote before pressing Reply (or 'R').

                c
                --
                Chris Lott <chris@...>

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

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.