Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

vim - 如何退出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.

(但是当我键入它时,它只是出现在对象主体中。)

  ask by jclancy translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.)

((请注意,大小写在这里很重要ZZzz并不意味着同一件事。))

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命令进行访问-在这里您可以找到所有问题的答案以及针对初学者的教程。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...