[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vim, tabs, and copying text



on Thu, Apr 10, 2003 at 09:35:14PM +0200, Torquil Macdonald (torquil@frisurf.no) wrote:
> I have the following problem with vim inside an xterm:
> If I write a file with a TAB at the start of each line in VIM, and try to copy 
> and paste it, with the mouse, into another VIM running in another xterm, I 
> get one extra TAB for each line like this:
> 
> 	lkk
> 	kh
> 	kjh
> 
> becomes
> 
> 	lkk
> 		kh
> 			kjh
> 
> I also get this when copying from other programs into VIM. Any ideas?

My preferred solution:

    :r!cat
    <paste text>
    ^D

...that is, invoke a piped-in input from 'cat', paste your text, and end
the input with <ctrl>-D (the EOF marker).

This doesn't require two mode changes (insert/command, paste/nopaste)
for pase ops.  I find it pretty natural.

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
   A guide to GNU/Linux browsers:
     http://twiki.iwethey.org/twiki/bin/view/Main/NixBrowsers



Reply to: