Re: paste with clipboard^=unnamed in the visual mode
- Hi Marcin!
On Mo, 15 Okt 2012, Marcin Szamotulski wrote:
> On 18:29 Mon 15 Oct , Christian Brabandt wrote:
> > On Sun, October 14, 2012 14:13, Marcin Szamotulski wrote:
> > > Hello VimDev,
> > >
> > > Answering a question on vim_use I found that when clipboard option
> > > has unnamed:
> > > set cb^=unnamed
> > > one cannot really paste in visual mode. I tested this in
> > > vim -u NONE --noplugin -c "set cb^=unnamed"
> > >
> > > The reason is quite simple. The "* register get a new value when
> > > entering the visual mode and the p command inserts what is currently
> > > highlighted.
> > >
> > > the solution is as simple as:
> > > vnoremap p ""p
> > >
> > > Should this be vim default? or maybe it should be noted in the
> > > documentation (in :help clipboard together with the explanation of the
> > > unnamed option).
> > Can you check, if this patch works for you?
> Yes it does. Though it has some consequences. For example when there is
> no autoselect in clipboard setting, one cannot first `visualise` a part
> of text in vim, then copy something into the * register (in another app)
> and paste it back in vim, since the paste will be done from the unnamed
> register. (When autoselect is in the clipboard it is not possible
> anyway, since vim owns the system clipboard).
> I can not think about any other scenario when the unnamed and
> * registers differ (while unnamed is in 'clipboard').
Indeed. Then we should possibly just document that behaviour. I am not
sure, how Vim should behave otherwise. It doesn't make sense to guess,
what register the user wanted to use.
-- Schuld ist wie ein Hügel - jeder sitzt auf seinem und zeigt auf die
-- Afrikanisches Sprichwort
You received this message from the "vim_dev" 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