Bug#419171: vim: adds extra spaces to text pasted from the clipboard

Pierre Habouzit madcoder at debian.org
Sat Apr 14 20:24:37 UTC 2007


On Sat, Apr 14, 2007 at 02:22:36PM -0400, Michael Gilbert wrote:
> On 4/14/07, Stefano Zacchiroli wrote:
> >Please also note that bug reporting is not meant to ask support
> >questions, for that you can find better help in the vim-user mailing
> >list or on IRC.
> 
> its useful for posterity.  other users (that search the bug database)
> will run into this and find the solution before asking the same thing.

  This has been asked at least 2 or 3 times though, so I think you
didn't searched enough :)

> btw, pastetoggle is a solution, but it is not optimal.  the average
> user would like to see paste toggling done automatically without their
> intervention.  this was the point of my original message.  is there
> any way for vim to automatically know that the text is coming in from
> the clipboard?

  Not the console version, as the paste is dealt with from X and your
term, way before vim. Though if you use an X-enabled build (like any vim
package but vim and vim-tiny) you will have the * and + registers
available and will be able to cut to and paste from the X clipboard and
selection buffers (:help registers / quotestar / clibpoard)

> or (and this is probably too application-specific) can the terminal
> program send vi into paste mode automatically when pasting?

  If you use shift-insert or the middle click, X simulates the paste by
sending the content of the clibpoard/selection buffer "as if you just
typed it". There is no way for an application to make a difference
between a paste and a _very_ fast typer.
  Applications that makes a distinction catch shift+insert or the middle
click and reimplement it their way. Vim's way to deal with the clipboard
are "+ and "* (and "~ which is a "+ alias IIRC) buffers.

Cheers,
-- 
·O·  Pierre Habouzit
··O                                                madcoder at debian.org
OOO                                                http://www.madism.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20070414/792b78e1/attachment.pgp


More information about the pkg-vim-maintainers mailing list