使用 gVim 时释放终端

Freeing Terminal While Using gVim

有什么方法可以让我的终端免于 运行gVim 进程 w/o 退出 gVim,以便我可以继续使用终端?我希望能够 做一些类似于我用 emacs 做的事情。使用 emacs,我可以使用 emacs [file] 命令通过终端让进程 运行,或者我可以使用 runemacs [file] 命令来保持终端空闲。

我用命令启动 gVim:

gvim [file]

然后终端挂起,直到我 :quit gVim。当我在网上搜索这个问题的答案时,人们建议最好的办法是使用 ctrl-z 暂停 vim 进程,然后使用 fg 到 return.但是,这在命令行和 gVim 模式下都对我不起作用。我在 Windows 7.

上为我的终端使用 Git Bash

您可以 运行 gvim 在后台运行,就像任何其他进程一样:

gvim [file] &

执行此命令后,您会收到一条消息,指示新进程的 pid。当您结束它时,您应该会在 shell.

上收到类似的消息

编辑:

ctrl-z/fg 问题可能与 windows 有关。 This question states that GitBash would create a new shell instead of returning to the current one, so it probably doesn't work as in Linux. A possible solution would be to run your commands from gVim, either calling the shell through :! on mappings, or plugins/commands (fugitive 用于 git、:py 或用于 python 解释器等的一些插件)。