1 |
On 1/28/2011 9:08 AM, Bill Longman wrote: |
2 |
> On 01/27/2011 12:53 PM, YoYo Siska wrote: |
3 |
>> BTW, if |
4 |
>> - vim has access to X (you run it on your local machine or from |
5 |
>> ssh -X or something similar) |
6 |
>> - is compiled with X support (check with vim --version | grep +X11) |
7 |
>> - and you :set mouse=a |
8 |
>> then you can paste by middle clicking in vim (not shift-middle click), |
9 |
>> which should paste the text as is... |
10 |
>> |
11 |
>> The difference is that with shift-middle click, or with vim that cannot |
12 |
>> talk to X, the terminal sends the selected text to vim as normal input |
13 |
>> (as if you would type it) and thus its get indented/formated/etc.. |
14 |
>> |
15 |
>> If you have mouse=a set and vim can talk to X, when you middle click |
16 |
>> it will ask X for the selection and insert it as is without any |
17 |
>> formatting |
18 |
> |
19 |
> Oooh, aaah. Fireworks. This one's going into my .vimrc file.... |
20 |
> |
21 |
|
22 |
You might like one too. |
23 |
|
24 |
cmap w!! w !sudo tee % >/dev/null |
25 |
|
26 |
When you forget to sudo vi you can use w!! which pipes writing the file |
27 |
though sudo. You get some term gunk, but it does work. |
28 |
|
29 |
kashani |