Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using GVim on Windows to edit remote Linux files?

Is it possible to use gvim to edit remote Linux files if I am running Windows?

To elaborate, I would like to connect to the Linux server via Putty and then use my local gvim instance to edit the files on the server -- Is this possible?

It seems x11 forwarding (via xming?) might be the solution but I cannot get it to work.

The remote server runs Debian; my local machine is Win7

like image 909
Marco Avatar asked Jul 26 '10 20:07

Marco


People also ask

Does Vim work over SSH?

Vim/NeoVim is just an editor but it relies on scp and ssh to provide access to remote files. So whenever you can ssh into any Linux box, you can also locally edit the file, while remotely saving that file into the remote server.


1 Answers

This should fix you up:

let g:netrw_cygwin = 0
let g:netrw_ssh_cmd  = '"C:\Program Files\PuTTY\plink.exe" -batch -T -ssh'
let g:netrw_scp_cmd  = '"C:\Program Files\PuTTY\pscp.exe"  -batch -q -scp'
let g:netrw_sftp_cmd = '"C:\Program Files\PuTTY\pscp.exe"  -batch -q -sftp'

See :help netrw-putty (and lots of scrolling around in that documentation page).

like image 63
Aristotle Pagaltzis Avatar answered Oct 05 '22 11:10

Aristotle Pagaltzis