Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-28 Thread Bill Longman
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



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-28 Thread kashani

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



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-28 Thread David Abbott
 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 !!!



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-28 Thread Bill Longman
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



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-27 Thread Mike Gilbert
On Thu, Jan 27, 2011 at 2:22 PM, Mark Knecht markkne...@gmail.com wrote:
 I solved it by creating a .vimrc file and putting

 set pastetoggle=F2

Running :set paste will do the job as well if you don't want to assign
a hot key for it.



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-27 Thread Petri Rosenström
On Thu, Jan 27, 2011 at 9:28 PM, Mike Gilbert floppymas...@gmail.com wrote:
 On Thu, Jan 27, 2011 at 2:22 PM, Mark Knecht markkne...@gmail.com wrote:
 I solved it by creating a .vimrc file and putting

 set pastetoggle=F2

 Running :set paste will do the job as well if you don't want to assign
 a hot key for it.



I usually do as Mike suggest. When I need to paste stuff into vim I
just type :set paste and paste the stuff and continue working.

Best regards
Petri



Re: [gentoo-user] Re: Paste into vim keeping indention or original?

2011-01-27 Thread YoYo Siska
On Thu, Jan 27, 2011 at 02:28:47PM -0500, Mike Gilbert wrote:
 On Thu, Jan 27, 2011 at 2:22 PM, Mark Knecht markkne...@gmail.com wrote:
  I solved it by creating a .vimrc file and putting
 
  set pastetoggle=F2
 
 Running :set paste will do the job as well if you don't want to assign
 a hot key for it.

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

yoyo