2

(没有其他建议,如 vim --servername,或 vim over ssh,或“仅使用 ssh”,或 nfs、sshfs。另外,我更喜欢避免更复杂的 netcat 化身,如 ncat)

我想通过网络编辑存在于另一台计算机上的文本文件,并且知道使用 netcat 并不是那么简单。但我相信如果对netcat有更深入的了解,这是可能的。我想获得更深层次的理解。

我知道如何使用管道和 fifo 使用 netcat 创建我自己的 REST 服务。我也知道您可以通过 netcat 公开整个 bash shell(是的,这很危险),但它不会显示提示。然而,它确实会在客户端上显示 bash 命令的输出。

必须做什么才能让文本编辑器(如 vim、pico、nano、emacs)在网络上工作以进行读写?

4

1 回答 1

1

来自 vim 文档:

Editing files over a network                *new-network-files*
----------------------------

Files starting with scp://, rcp://, ftp:// and http:// are recognized as
remote files.  An attempt is made to access these files with the indicated
method.  For http:// only reading is possible, for the others writing is also
supported.  Uses the netrw.vim script as a standard "plugin". |netrw|

另一个教程:http: //vim.wikia.com/wiki/Edit_remote_files_locally_via_SCP/RCP/FTP


# open a remote file
vim scp://remote-computer:22//tmp/file.txt

# ... EDIT ...

# write it back (run in vim)
:Nwrite
于 2014-08-16T00:50:00.933 回答