How to quit vim safely?
:wq
Save and quit. If you create a new file and write none , use the command, the new file will not disappear and will be save with no word.
ZZ
Save and quit. Note that is upper case. If you create a new file, and write even one character (and than you delete the character you have writen), ZZ will save the file. But if you has not writen any time, the file will disappear, even you had enter insert mode.
:q!
Quit and don't save.
本文介绍了如何在Vim编辑器中安全地保存并退出,包括三种常用命令:使用`:wq`保存并退出;使用`:ZZ`保存并退出,需要注意的是此命令区分大小写;使用`:q!`不保存直接退出。
166

被折叠的 条评论
为什么被折叠?



