Vim Tips Wiki
m (Category: Integration)
m (Fixed pipe problem)
Line 9: Line 9:
 
|rating=22/7
 
|rating=22/7
 
|text=
 
|text=
Have you ever wished that you could compare a text file on your Windoze machine with one on your FreeBSD|Redhat box? Now you can!
+
Have you ever wished that you could compare a text file on your Windoze machine with one on your FreeBSD{{|}}Redhat box? Now you can!
 
 
 
In addition to Vim (which you'll have anyway) you'll need PSCP (which you can download from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) and diff.exe. If you are using Pageant you will not even have to worry about passwords!
 
 
   
 
In addition to Vim (which you'll have anyway) you'll need PSCP (which you can download from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) and diff.exe. If you are using Pageant you will not even have to worry about passwords!
   
 
Add to your .vimrc:
 
Add to your .vimrc:
Line 73: Line 69:
 
dvdm--AT----AT--xs4all.nl
 
dvdm--AT----AT--xs4all.nl
 
, April 12, 2006 5:01
 
, April 12, 2006 5:01
----
 
I too see the same problem with the single quote
 
 
satish_khar--AT--yahoo.com
 
, July 11, 2006 8:39
 
 
----
 
----
 
Looks like the single quotes is added only in vim7.0, when I switched back to 6.2 it works.
 
Looks like the single quotes is added only in vim7.0, when I switched back to 6.2 it works.

Revision as of 19:37, 23 July 2007

Previous TipNext Tip

Tip: #1181 - Using PuTTY pscp with Vim

Created: March 21, 2006 18:19 Complexity: basic Author: Pete Johns Version: 6.0 Karma: 22/7 Imported from: Tip#1181

Have you ever wished that you could compare a text file on your Windoze machine with one on your FreeBSD{{|}}Redhat box? Now you can!

In addition to Vim (which you'll have anyway) you'll need PSCP (which you can download from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) and diff.exe. If you are using Pageant you will not even have to worry about passwords!

Add to your .vimrc:


"""" 20060318 paj using PSCP on Windows. N.B: Works best with Pageant.

if ($OS =~"Windows")

let g:netrw_scp_cmd="\"c:\\Program Files\\PuTTY\\pscp.exe\" -q -batch" 

endif


C:\>vim -d \path\to\vimfiles\colors\primitive.vim scp://user@my.host/path/to/.vim/colors/primitive.vim


For further information on Vim's scp capabilities, see:


he scp


--paj


--

Pete Johns <> http://johnsy.com/>;

Tel/Fax numbers and IM information: <> http://johnsy.com/contact/>;

Bebo and co. <> http://johnsy.com/blog/?entry=20060318201737>;

Comments

Hi,

This doesn't seem to work for me because pscp seems to put the remote host 'foo--AT--bar.com:/dir' in single quotes. Then the command line fails.

Is there any way to force netrw not to use single quotes in the command line?

Thx!


decuir--AT--gmail.com , March 28, 2006 9:07


I have exactly the same problem. Can't get rid of the single quotes.

dvdm--AT----AT--xs4all.nl , April 12, 2006 5:01


Looks like the single quotes is added only in vim7.0, when I switched back to 6.2 it works.

Satish Kharat , July 11, 2006 8:47


There's a hack I found on Google which makes pscp work with Vim7:

In the netrw.vim file (normally vim70/autoload/netrw.vim), search for the following line (normally line 557) and remove single quotes: exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".tmpfile

It works perfectly for me! :)

Thanks for HBTaylor! [http://groups.google.hu/group/comp.editors/browse_thread/thread/adf797ee3e934037/83a652699e8e38ad?lnk=st&q=vim+pscp&rnum=1#83a652699e8e38ad]

vass.laszlo--AT--altair.hu , September 19, 2006 2:23