[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: gvim paste from windows clipboard
From:       Benji Fisher <benji () member ! AMS ! org>
Date:       2006-03-31 23:25:19
Message-ID: 20060331232519.GE4319 () localhost ! localdomain
[Download RAW message or body]

On Fri, Mar 31, 2006 at 01:33:49PM -0500, Bob Hensell wrote:
> Please disregard my previous email, and reply to this email, thank you:
> 
> Does anyone have a tip for me?  I am running gvim 6.4 from cygwin on my XP
> machine.  Whenever I try to paste into gvim from another application using
> the middle mouse button, the text gets pasted, but a ^@ also gets appended
> to each line of my text.  Is there something I can put into my .vimrc file?
> I've tried the mswin.vim but that didn't help.  I'm rather new to vim and
> gvim.  I work with UNIX servers all day, so I'm used to vi, but I like the
> script coloring that is available in vim.  Any help would be greatly
> appreciated because as it works now with the appending text, it makes it
> virtually unusable because I do a lot of pasting into my scripts.
> 
> Thanks!

     Try something like this.  Starting in Normal mode, type "= and
then, at the command line,

substitute(@*, '\n', '\n', 'g')

with a <CR> to finish that line, then complete the command with p .  I
think the first \n is right, but maybe the second should be \r or
something; experiment a bit.  If it is correct as written, map some key
to do it quickly, e.g.

:nmap <F3> "=substitute(@*, '\n', '\n', 'g')<CR>p

Odd though it seems, I actually think that you do want \n twice.

HTH					--Benji Fisher
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic