How to use GVIM to edit a remote file?

前端 未结 10 1592
日久生厌
日久生厌 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:04

    EDIT: Key authentication is not necessary for opening files over ssh. Vim will prompt for password.

    It would be useful to note if netrw.vim was loaded by vim when it started.

    :echo exists("g:loaded_netrwPlugin")
    

    For opening files over ssh, you need your local machine's public key in the server's authorized keys. Following help section in vim documentation explains it pretty well.

    :help netrw-ssh-hack
    

    Quick way to export public key would be by using ssh-copy-id (if available).

    ssh-copy-id user@host
    

    And have a look at netrw documentation for network file editing over other protocols.

    :help netrw
    

    HTH.

提交回复
热议问题