如何退出 Vim 编辑器? [英] How do I exit the Vim editor?
问题描述
我被困住了,无法逃脱.它说:
I'm stuck and cannot escape. It says:
"type :quit<Enter> to quit VIM"
但是当我输入它时,它只会出现在对象主体中.
But when I type that it simply appears in the object body.
推荐答案
按 Esc 键进入普通模式".然后你可以输入:
进入命令行模式".冒号 (:
) 将出现在屏幕底部,您可以输入以下命令之一.要执行命令,请按 Enter 键.
Hit the Esc key to enter "Normal mode". Then you can type :
to enter "Command-line mode". A colon (:
) will appear at the bottom of the screen and you can type in one of the following commands. To execute a command, press the Enter key.
:q
退出(:quit
的缩写):q!
退出而不保存(:quit!
的缩写):wq
写入并退出:wq!
写入并退出即使文件只有读取权限(如果文件没有写入权限:强制写入):x
写入并退出(类似于:wq
,但只有在有变化时才写入):exit
写入并退出(同:x
):qa
退出所有(:quitall
的缩写):cq
退出而不保存并使 Vim 返回非零错误(即错误退出)
:q
to quit (short for:quit
):q!
to quit without saving (short for:quit!
):wq
to write and quit:wq!
to write and quit even if file has only read permission (if file does not have write permission: force write):x
to write and quit (similar to:wq
, but only write if there are changes):exit
to write and exit (same as:x
):qa
to quit all (short for:quitall
):cq
to quit without saving and make Vim return non-zero error (i.e. exit with error)
你也可以通过输入ZZ
保存并退出(同:x
)或ZQ
直接从普通模式"退出Vim退出(与 :q!
相同).(注意这里的大小写很重要.ZZ
和 zz
不是同一个意思.)
You can also exit Vim directly from "Normal mode" by typing ZZ
to save and quit (same as :x
) or ZQ
to just quit (same as :q!
). (Note that case is important here. ZZ
and zz
do not mean the same thing.)
Vim 有广泛的帮助 - 您可以使用 :help
命令访问 - 您可以在其中找到所有问题的答案和初学者教程.
Vim has extensive help - that you can access with the :help
command - where you can find answers to all your questions and a tutorial for beginners.
这篇关于如何退出 Vim 编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!