sftp file browsing
Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? I can run ':e sftp://sage/nessus_conf/nessusd.conf' to edit a particular file, but if I don't know the exact filename I'd like to be able to run something like ':e sftp://sage/nessus_conf/' to get a directory listing. Thanks. -- Jared
RE: sftp file browsing
I think you want to look at the netrw plugin for vim, which is (as far as I can remember) installed by default, although I remember that it is recommended that you download the latest version for full support. :help netrw http://www.vim.org/scripts/script.php?script_id=1075 Hope that helps! Max -Original Message- From: Jared [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 30, 2006 9:19 AM To: vim@vim.org Subject: sftp file browsing Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? I can run ':e sftp://sage/nessus_conf/nessusd.conf' to edit a particular file, but if I don't know the exact filename I'd like to be able to run something like ':e sftp://sage/nessus_conf/' to get a directory listing. Thanks. -- Jared
Re: sftp file browsing
On Tue, May 30, 2006 at 11:19:11AM -0500, Jared wrote: Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? I can run ':e sftp://sage/nessus_conf/nessusd.conf' to edit a particular file, but if I don't know the exact filename I'd like to be able to run something like ':e sftp://sage/nessus_conf/' to get a directory listing. If you are on Linux you can mount a remote filesystem via sshfs. Here's a tutorial: http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ Then you can work on the remote system as though it were local. -- yours, William signature.asc Description: Digital signature
Re: sftp file browsing
On Tue, May 30, 2006 at 11:19:11AM -0500, Jared wrote: Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? [...] I'd like to be able to run something like ':e sftp://sage/nessus_conf/' to get a directory listing. This already works with newer versions of the netrw plugin. An upgrade would probably solve this issue for you. -- with kind regards Thor Andreassen
Re: sftp file browsing
Jared wrote: Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? I can run ':e sftp://sage/nessus_conf/nessusd.conf' to edit a particular file, but if I don't know the exact filename I'd like to be able to run something like ':e sftp://sage/nessus_conf/' to get a directory listing. Yes, netrw supports browsing remote folders using ftp. However, sftp isn't ftp; fundamentally, its ssh. Netrw also supports browsing using ssh. So, what happens when you try: vim sftp://sage/nessus_conf/ Netrw will attempt to use ssh to do the browsing, and will use sftp to do file transfer. Regards, Chip Campbell
Re: sftp file browsing
On 05/30/2006 13:00, Thor Andreassen wrote: On Tue, May 30, 2006 at 11:19:11AM -0500, Jared wrote: Is it possible to browse a remote folder through FTP? Eg, if I enter ':e .' it'll display the directory browser for the current directory. How can I do the same for remote directories? This already works with newer versions of the netrw plugin. An upgrade would probably solve this issue for you. hmm... I just realized that I was trying this on 6.3. The only copy of Vim 7 I have available is on my Windows box, but of course there is no sftp command. I do have pftp from PuTTY, however. I can I change the command that netrw uses? I see from the docs that it's saved in the g:netrw_sftp_cmd variable, but I can't figure out how to change it. Thanks. -- Jared
Re: sftp file browsing
On Tue, 2006-05-30 at 16:36:23 -0500, Jared sent: hmm... I just realized that I was trying this on 6.3. The only copy of Vim 7 I have available is on my Windows box, but of course there is no sftp command. I do have pftp from PuTTY, however. I can I change the command that netrw uses? I see from the docs that it's saved in the g:netrw_sftp_cmd variable, but I can't figure out how to change it. This should work on v6.3: 20060318 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 Now with added SFTP: let g:netrw_sftp_cmd=\c:\\Program Files\\PuTTY\\psftp.exe\ endif }}} I don't have access to an sftp server to test it, but the scp line works. I hope this helps; --paj -- Pete Johns http://johnsy.com/ Tel/Fax numbers and IM information http://johnsy.com/contact/ Yet Another Blog Entry http://johnsy.com/20060525103459 pgppWEeDyqB4E.pgp Description: PGP signature
Re: sftp file browsing
On Wed, 2006-05-31 at 09:19:09 +1000, Pete Johns sent: [A badly-formatted email] That should read: 20060318 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 Now with added SFTP: let g:netrw_sftp_cmd=\c:\\Program Files\\PuTTY\\psftp.exe\ endif }}} -- Pete Johns http://johnsy.com/ Tel/Fax numbers and IM information http://johnsy.com/contact/ Yet Another Blog Entry http://johnsy.com/20060525103459 pgpvw43hKOdlU.pgp Description: PGP signature