如何使gvim保持终端直到结束?

如何使gvim保持终端直到结束?,vim,find,xargs,Vim,Find,Xargs,我尝试使用gvim查找并替换文件层次结构,如下所示: find . | xargs grep -l pattern | xargs -n 1 gvim -c "%s/pattern/replacement/gc" -c "wq" 我可能会尝试让它在没有n标志的情况下正常工作,但是理论上我可以有很多匹配的文件。现在发生的是,gvim从终端断开连接,因此xargs以很小的延迟一个接一个地启动gvim的所有实例。若我可以强制gvim保持终端,xargs将等待gvim完成,这样就只有一个gvim实

我尝试使用gvim查找并替换文件层次结构,如下所示:

  find . | xargs grep -l pattern | xargs -n 1 gvim -c "%s/pattern/replacement/gc" -c "wq"
我可能会尝试让它在没有n标志的情况下正常工作,但是理论上我可以有很多匹配的文件。现在发生的是,gvim从终端断开连接,因此xargs以很小的延迟一个接一个地启动gvim的所有实例。若我可以强制gvim保持终端,xargs将等待gvim完成,这样就只有一个gvim实例在运行


不幸的是,我不能在与此相关的环境中使用vim。我从一位同事那里获得了一个用于gvim的工作二进制文件,但他们没有vim二进制文件,我自己编译vim失败,现在放弃了它。

您正在寻找
-f
命令行选项:


您正在查找
-f
命令行选项:

-f        GUI: Do not disconnect from the program that started Vim.
          'f' stands for "foreground".  If omitted, the GUI forks a new
          process and exits the current one.  "-f" should be used when
          gvim is started by a program that will wait for the edit
          session to finish (e.g., mail or readnews).  If you want gvim
          never to fork, include 'f' in 'guioptions' in your |gvimrc|.