Re: vim, tabs, and copying text
-- Torquil Macdonald <torquil@frisurf.no> wrote
(on Thursday, 10 April 2003, 09:35 PM +0200):
> 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?
Add the following line to your ~/.vimrc
:set pastetoggle=<Ins>
Then, before pasting, hit <Ins>, which will put VIM into paste mode;
once done, hit it again to get out of paste mode. This will get rid of
the extra tabs, which are a result of having expandtab set (which is
usually a good thing to set).
--
Matthew Weier O'Phinney
matthew@weierophinney.net
http://matthew.weierophinney.net
Reply to: