ileyar
V2EX  ›  问与答

如何调用本地的 Vim 修改远程 VPS 上的文件?

  •  
  •   ileyar · Jun 22, 2015 · 4493 views
    This topic created in 4152 days ago, the information mentioned may be changed or developed.

    如题。本机 Ubuntu,使用的终端版 vim
    之前在 v2ex 上看到过类似问题的帖子,现在找不到了...

    9 replies  •  2015-06-23 08:32:36 +08:00
    linhua
    linhua
    Jun 22, 2015
    1
    从原理上来分析:必须得把文件下载到本地,修改后,再上传到vps上
    (就算是用diff文件的形式,只上传diff文件,也需要了解在哪行添加,或删除哪行)
    可用rsync同步,sshfs。
    rsync最好
    giskard
    giskard
    Jun 22, 2015
    2
    试试这样行不行:vim scp://user@IP/~/remote.txt
    xmbaozi
    xmbaozi
    Jun 22, 2015
    4
    又是你 哈哈
    guoqiao
    guoqiao
    Jun 22, 2015
    5
    还是把本地的vimrc传到服务器来的快.
    cbsw
    cbsw
    Jun 22, 2015
    6
    C-x C-f /ssh:VPS_USERNAME@VPS_IP:FILE_PATH
    对,就是Emacs,跟编辑本地文件一样方便
    wittyfox
    wittyfox
    Jun 22, 2015
    7
    试试 Emacs,直接在 Emacs 里远程编辑文件,不需要拷贝回来修改后再拷贝回去。
    df4VW
    df4VW
    Jun 22, 2015
    8
    vim scp 就可以
    ileyar
    ileyar
    OP
    Jun 23, 2015
    9
    @linhua
    @giskard
    @agassi_yzh
    @df4VW
    你们说的差不多是一个方法,看来目前是只有这个编辑方法了。

    @xmbaozi 又是我~ :p

    @cbsw
    @wittyfox
    有机会试试 Emacs :)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2655 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 15:13 · PVG 23:13 · LAX 07:13 · JFK 10:13
    ♥ Do have faith in what you're doing.