On Wednesday, September 10, 2014 6:31:53 AM UTC+5:30, Jason Pleau wrote:
> Hello,
> 
> 
> 
> I cannot paste from the system clipboard with vim if it is opened after 
> 
> I copied my text into the clipboard. I am using set clipboard=unnamedplus.
> 
> 
> 
> A bisect with hg has lead me to believe that this change introduced my 
> 
> clipboard issue:
> 
> 
> 
> http://code.google.com/p/vim/source/detail?r=7766142fc7d3e90c2e15a9c606efcd97331edef8
> 
> 
> 
> 
> 
> 
> 
> I am on Linux (Debian unstable).
> 
> 
> 
> This is what I use as a minimal vimrc to reproduce:
> 
> 
> 
> set clipboard=unnamedplus
> 
> finish
> 
> 
> 
> --
> 
> 
> 
> I was compiling vim with this command:
> 
> 
> 
> /configure --prefix=$HOME/vim-test/local --enable-multibyte --enable-xim 
> 
> --with-features=huge && make && make install
> 
> 
> 
> 
> 
> 
> 
> To reproduce:
> 
> 
> 
> 1. Copy some text into the system clipboard (with ctrl-c in chromium or 
> 
> firefox for example).
> 
> 
> 
> 2. open vim/gvim (using the .vimrc I wrote above)
> 
> 
> 
> 3. Try to paste using p or "+p - I get E353: Nothing in register +
> 
> 
> 
> 4. If you copy your text again and try to paste in the same vim window, 
> 
> it will work.
> 
> 
> 
> 
> 
> 
> 
> Thanks !

Add the following to .vimrc

"Copy contents of System Clipboard to + buffer when entering vim
autocmd VimEnter * call setreg('+', system('xsel -ob')) 
"Copy contents of + buffer to System Clipboard while leaving vim
autocmd VimLeave * call system("xsel -ib", getreg('+'))

This should solve your problem and also the problem of vim "+" buffer contents 
not being availble to System Clipboard when vim is exited.

Note: Thanks to @Raimondi at #vim for helping me with the solution.

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui