Thursday, July 18, 2013

yank / delete / paste without output

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

No comments: