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://myus...@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://myus...@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
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://myus...@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
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 us...@host.com ls -Fa "
Regards,
Ken Takata
let g:netrw_silent = 1
let g:netrw_list_cmd = "C:\\Programs\\PuTTY\\plink.exe -P 22 -pw password use...@192.168.1.20 ls -Fa "
let g:netrw_scp_cmd = "C:\\Programs\\PuTTY\\pscp -P 22 -pw password -scp "
e scp://use...@192.168.1.20//path/to/dir/