How to use GVIM to edit a remote file?

前端 未结 10 1597
日久生厌
日久生厌 2021-01-30 03:47

I use GVIM on Ubuntu 9.10. I\'m looking for the right way to configure GVIM to be able to edit remote files (HTML, PHP, CSS) by for exemple ftp.

  • When i use :e scp:
10条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 04:15

    There is one way and that is using the remote host's copy, using SSH to forward the X11 client to you, like so:

    user@local:~/$ ssh -X user@host
    ...
    user@host:~/$ gvim file
    

    The latter command should open gvim on your desktop. Of course, this relies on the remote host having X11 / gnome / gvim installed in the first place, which might not be the solution you're looking for / an option in your case.

    Note: X11 forwarding can be a security risk.

提交回复
热议问题