当 运行 使用 --remote-tab-silent 选项时如何从标准输入读取缓冲区?

How to make read buffer from standard input when run with --remote-tab-silent option?

以下命令成功启动 vim 从标准输入读取编辑缓冲区。

echo hi | vim -

但是这个不行。

echo hi | vim --remote-tab-silent -

当上述命令为运行时,会出现以下警告并vim退出。

Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: preserving files...
Vim: Finished.

为什么在第二种情况下它不从标准输入读取?

vim的帮助信息好像是说应该有用?

$ vim -h | head
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 31 2015 23:36:07)

usage: vim [arguments] [file ..]       edit specified file(s)
   or: vim [arguments] -               read text from stdin
   or: vim [arguments] -t tag          edit file where tag is defined
   or: vim [arguments] -q [errorfile]  edit file with first error

Arguments:
   --           Only file names after this
   -g           Run using GUI (like "gvim")
$ vim -h | grep remote
   --remote <files> Edit <files> in a Vim server if possible
   --remote-silent <files>  Same, don't complain if there is no server
   --remote-wait <files>  As --remote but wait for files to have been edited
   --remote-wait-silent <files>  Same, don't complain if there is no server
   --remote-tab[-wait][-silent] <files>  As --remote but use tab page per file
   --remote-send <keys> Send <keys> to a Vim server and exit
   --remote-expr <expr> Evaluate <expr> in a Vim server and print result

当使用 --remote.

时,您无法从 stdin 进行编辑
:h --remote


 --remote [+{cmd}] {file} ...
                          Open the file list in a remote Vim.  When
                          there is no Vim server, execute locally.
                          There is one optional init command: +{cmd}.
                          This must be an Ex command that can be
                          followed by "|".
                          The rest of the command line is taken as the
                          file list.  Thus any non-file arguments must
                          come before this.
                          <b>You cannot edit stdin this way |--|.</b>
                          The remote Vim is raised.  If you don't want
                          this use >
                           vim --remote-send "<C-\><C-N>:n filename<CR>"</p>

<p>--remote-silent [+{cmd}] {file} ...<br>
                          As above, but don't complain if there is no
                          server and the file is edited locally.</p>

<p>--remote-tab-silent      Like --remote-silent but open each file in a
                          new tabpage.
</pre>