不能用 :!q 退出 Vim

Rod*_*igo 39 vim

我在一个文本中做了错误的更改,现在我想不保存就离开 Vim。我知道我必须在正常模式下输入 :!q ,但是当我这样做时,它说:

[No write since last change]
/bin/bash: q: command not found

shell returned 127

Press ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)

如果我单击 ENTER 或其他任何东西,它会返回到 Vim。这是怎么回事?

Lam*_*ert 51

使用:q!. :!q告诉vim执行q您的示例中调用的命令。

另请参阅:help !:help quit了解详情