Hit the Esc key to enter "Normal mode".
(按Esc键进入“普通模式”。)
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. (要执行命令,请按Enter键。)
-
:q
to quit (short for :quit
) (:q
退出( :quit
缩写))
-
:q!
to quit without saving (short for :quit!
) (退出而不保存( :quit!
缩写))
-
:wq
to write and quit (:wq
编写并退出)
-
: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) (:x
进行写入和退出(类似于:wq
,但仅在有更改时才写入))
-
:exit
to write and exit (same as :x
) (:exit
写入并退出(与:x
相同))
-
:qa
to quit all (short for :quitall
) (:qa
退出所有( :quitall
))
-
:cq
to quit without saving and make Vim return non-zero error (ie exit with error) (:cq
不保存就退出,并使Vim返回非零错误(即退出时出现错误))
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!
).
(您也可以通过输入ZZ
保存并退出(与:x
相同)或通过ZQ
退出(与:q!
相同)直接从“普通模式”退出Vim。)
(Note that case is important here. ZZ
and zz
do not mean the same thing.) ((请注意,大小写在这里很重要ZZ
和zz
并不意味着同一件事。))
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提供了广泛的帮助-您可以使用:help
命令进行访问-在这里您可以找到所有问题的答案以及针对初学者的教程。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…