Thursday, July 18, 2013

Re: yank / delete / paste without output

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@googlegroups.com.
> 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

No comments: