如何从 vi 返回 ex 模式?

How to go back in ex mode from vi?

我正在学习 vi/vim。最近,我遇到了一些不确定的问题。当我 运行:

ex somefile

ex 编辑器打开。好的,很好。玩了一会儿我 运行:

:vi

现在我处于正常的 vi 模式。这里一切都很清楚。但问题是: 我怎样才能回到ex模式(我第一次从bash运行ex filename)?我试过 [shift]+[q](因此是 Q),但没有任何反应。

您没有说明您使用的 vim 是什么版本,但是帮助 (:help ex-mode) 确实是这样说的:

Note: In older versions of Vim "Q" formatted text,
that is now done with gq. But if you use the
vimrc_example.vim script "Q" works like "gq".

所以你可以在正常模式下尝试 gq 或者帮助也说

gQ Switch to "Ex" mode like with "Q", but really behave
like typing ":" commands after another.

在这种情况下,您可以在正常模式下尝试 gQ