How to use file explorer on my local gVim to access remote file system?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use file explorer on my local gVim to access remote file system?

Igor Forca
Hi,
I am using latest gVim v8.1.0513 nightly build on Windows 7, both 64-bit.

I have several Linux machines accessible using ssh. Now I am using local machine's Vim through Putty on every machine. But there are several problems, there are different versions on Vim (some pretty old one) and there are different vim settings, different syntax highlighting etc and there is sometimes even lack of responsiveness and similar.

On my Windows I have gVim customized to my wishes.

From my Windows PC's gVim I would like to access files on remote Linux machines, edit and save. On my PC I have created text file with the following commands:

let g:netrw_silent = 1
let g:netrw_scp_cmd = "\"C:\\Programs\\PuTTY\\pscp.exe\" -pw mypassword "
e scp://myuserid@192.168.1.20//path/to/file.txt

When I open a gVim on Windows I can source that file:
:source commands.vim

and file.txt from remote machines is opened, I can edit it and save changes it works perfectly for individual file.

Now to the problem. I have hundreds of files that I need to edit. So it would be way more convenient to open file explorer for remote file system.
On my local machine to access my local PC's files I can open file explorer with command: :E
How to do this for remote machine?

I looked into commands.vim and changed the last line to:
e scp://myuserid@192.168.1.20//path/

but I get the error:
**error** (netrw) your g:netrw_list_cmd is empty; perhaps ssh is not executable on your system

Any idea how to use file explorer on remote machine accessed from my local gVim?

Thanks

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

Tony Mechelynck
On Mon, Nov 12, 2018 at 9:09 AM Igor Forca <[hidden email]> wrote:

>
> Hi,
> I am using latest gVim v8.1.0513 nightly build on Windows 7, both 64-bit.
>
> I have several Linux machines accessible using ssh. Now I am using local machine's Vim through Putty on every machine. But there are several problems, there are different versions on Vim (some pretty old one) and there are different vim settings, different syntax highlighting etc and there is sometimes even lack of responsiveness and similar.
>
> On my Windows I have gVim customized to my wishes.
>
> From my Windows PC's gVim I would like to access files on remote Linux machines, edit and save. On my PC I have created text file with the following commands:
>
> let g:netrw_silent = 1
> let g:netrw_scp_cmd = "\"C:\\Programs\\PuTTY\\pscp.exe\" -pw mypassword "
> e scp://myuserid@192.168.1.20//path/to/file.txt
>
> When I open a gVim on Windows I can source that file:
> :source commands.vim
>
> and file.txt from remote machines is opened, I can edit it and save changes it works perfectly for individual file.
>
> Now to the problem. I have hundreds of files that I need to edit. So it would be way more convenient to open file explorer for remote file system.
> On my local machine to access my local PC's files I can open file explorer with command: :E
> How to do this for remote machine?
>
> I looked into commands.vim and changed the last line to:
> e scp://myuserid@192.168.1.20//path/
>
> but I get the error:
> **error** (netrw) your g:netrw_list_cmd is empty; perhaps ssh is not executable on your system
>
> Any idea how to use file explorer on remote machine accessed from my local gVim?
>
> Thanks

It may depend on the configuration of your remote server: depending on
how you can access it, it may or may not allow you access to the
directories of its folders. If you have ftp access (possibly with
username and password), then directories are usually available. For
other access modes (http, scp, etc), I don't know.

See also:
    :help g:netrw_ftp_cmd
    :help netrw-windows-netrc (for Windows only)
    :help netrw-netrc (usually not for Windows)

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

Igor Forca
Tony,
this server does not have FTP installed and admin does not permit installing it.

I have now tested on my "Ubuntu 18.04 desktop" PC machine (not used frequently) with vim 8.0.1766 installed and executed only one command:
:e scp://myuserid@192.168.1.20//path/
and file explorer opened without a problem and I can use arrow keys to select file and file is opened successfully. (The only tiny problem is it asks for password for every task I execute, but this is expected, because no password related settings are set). So there is probably no directory listing problem on this remote server.

It looks like a Windows specific problem. Maybe some additional setting is required or something?
Regards

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

Tony Mechelynck
On Mon, Nov 12, 2018 at 10:09 AM Igor Forca <[hidden email]> wrote:

>
> Tony,
> this server does not have FTP installed and admin does not permit installing it.
>
> I have now tested on my "Ubuntu 18.04 desktop" PC machine (not used frequently) with vim 8.0.1766 installed and executed only one command:
> :e scp://myuserid@192.168.1.20//path/
> and file explorer opened without a problem and I can use arrow keys to select file and file is opened successfully. (The only tiny problem is it asks for password for every task I execute, but this is expected, because no password related settings are set). So there is probably no directory listing problem on this remote server.
>
> It looks like a Windows specific problem. Maybe some additional setting is required or something?
> Regards

For scp it seems (from the netrw documentation) that the problem is
not even Windows-related, see :help netrw-passwd §2. But there is
there a link to :help netrw-ssh-hack — maybe that can help you… ah,
about 1½ screen lower than that there is a paragraph starting "For
Windows users". The rest may or may not be applicable to you.

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

Ken Takata-2
In reply to this post by Igor Forca
Hi,

2018/11/12 Mon 17:09:52 UTC+9 Igor Forca wrote:

> Hi,
> I am using latest gVim v8.1.0513 nightly build on Windows 7, both 64-bit.
>
> I have several Linux machines accessible using ssh. Now I am using local machine's Vim through Putty on every machine. But there are several problems, there are different versions on Vim (some pretty old one) and there are different vim settings, different syntax highlighting etc and there is sometimes even lack of responsiveness and similar.
>
> On my Windows I have gVim customized to my wishes.
>
> From my Windows PC's gVim I would like to access files on remote Linux machines, edit and save. On my PC I have created text file with the following commands:
>
> let g:netrw_silent = 1
> let g:netrw_scp_cmd = "\"C:\\Programs\\PuTTY\\pscp.exe\" -pw mypassword "
> e scp://myuserid@192.168.1.20//path/to/file.txt
>
> When I open a gVim on Windows I can source that file:
> :source commands.vim
>
> and file.txt from remote machines is opened, I can edit it and save changes it works perfectly for individual file.
>
> Now to the problem. I have hundreds of files that I need to edit. So it would be way more convenient to open file explorer for remote file system.
> On my local machine to access my local PC's files I can open file explorer with command: :E
> How to do this for remote machine?
>
> I looked into commands.vim and changed the last line to:
> e scp://myuserid@192.168.1.20//path/
>
> but I get the error:
> **error** (netrw) your g:netrw_list_cmd is empty; perhaps ssh is not executable on your system
So, did you set g:netrw_list_cmd?
If not try setting it.
E.g. https://stackoverflow.com/a/8996320
> let g:netrw_list_cmd = "plink.exe -P ##### -pw MyPass [hidden email] ls -Fa "


Regards,
Ken Takata

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

Igor Forca
@Ken, thanks a lot that it! Problem solved. Now I can open files and folders.
Just for reference, the final code is:

let g:netrw_silent = 1
let g:netrw_list_cmd = "C:\\Programs\\PuTTY\\plink.exe -P 22 -pw password useridt@192.168.1.20 ls -Fa "
let g:netrw_scp_cmd  = "C:\\Programs\\PuTTY\\pscp -P 22 -pw password -scp "
e scp://userid@192.168.1.20//path/to/dir/

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to use file explorer on my local gVim to access remote file system?

arocker
In reply to this post by Igor Forca
>
> Now to the problem. I have hundreds of files that I need to edit.

That doesn't sound a situation a human being should have to grind through.
Is there any possibility of automating the process, using something like sed?


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.