FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-28-2011, 04:08 PM
Bill Longman
 
Default Paste into vim keeping indention or original?

On 01/27/2011 12:53 PM, YoYo Siska wrote:
> BTW, if
> - vim has access to X (you run it on your local machine or from
> ssh -X or something similar)
> - is compiled with X support (check with vim --version | grep +X11)
> - and you :set mouse=a
> then you can paste by middle clicking in vim (not shift-middle click),
> which should paste the text as is...
>
> The difference is that with shift-middle click, or with vim that cannot
> talk to X, the terminal sends the selected text to vim as normal input
> (as if you would type it) and thus its get indented/formated/etc..
>
> If you have mouse=a set and vim can talk to X, when you middle click
> it will ask X for the selection and insert it as is without any
> formatting

Oooh, aaah. Fireworks. This one's going into my .vimrc file....
 
Old 01-28-2011, 07:03 PM
kashani
 
Default Paste into vim keeping indention or original?

On 1/28/2011 9:08 AM, Bill Longman wrote:

On 01/27/2011 12:53 PM, YoYo Siska wrote:

BTW, if
- vim has access to X (you run it on your local machine or from
ssh -X or something similar)
- is compiled with X support (check with vim --version | grep +X11)
- and you :set mouse=a
then you can paste by middle clicking in vim (not shift-middle click),
which should paste the text as is...

The difference is that with shift-middle click, or with vim that cannot
talk to X, the terminal sends the selected text to vim as normal input
(as if you would type it) and thus its get indented/formated/etc..

If you have mouse=a set and vim can talk to X, when you middle click
it will ask X for the selection and insert it as is without any
formatting


Oooh, aaah. Fireworks. This one's going into my .vimrc file....



You might like one too.

cmap w!! w !sudo tee % >/dev/null

When you forget to sudo vi you can use w!! which pipes writing the file
though sudo. You get some term gunk, but it does work.


kashani
 
Old 01-28-2011, 07:20 PM
David Abbott
 
Default Paste into vim keeping indention or original?

> On 01/27/2011 12:53 PM, YoYo Siska wrote:
>> BTW, if
>> *- vim has access to X (you run it on your local machine or from
>> * *ssh -X or something similar)
>> *- is compiled with X support (check with vim --version | grep +X11)
>> *- and you :set mouse=a
>> then you can paste by middle clicking in vim (not shift-middle click),
>> which should paste the text as is...
Thank You !!!
 
Old 01-28-2011, 09:42 PM
Bill Longman
 
Default Paste into vim keeping indention or original?

On 01/28/2011 12:03 PM, kashani wrote:
>
> You might like one too.
>
> cmap w!! w !sudo tee % >/dev/null
>
> When you forget to sudo vi you can use w!! which pipes writing the file
> though sudo. You get some term gunk, but it does work.

That's what "screen" and PS1 are for....
 

Thread Tools




All times are GMT. The time now is 05:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org