I tried it, but it didn’t work. Then Baidu went to other methods and posted them:
Press the ESC key to make sure you are not in edit mode and type :wq
Esc key to make sure you exit insert mode, then: wq (colon W Q) or ZZ (Shift Z Offset-Z).
I can provide you two links that can help you with vim: instead of telling you how you can execute (wq esc) a quick reference card is provided in HTML a quick reference card is provided in PDF format in multiple languages, for printing CodeGo.net, Fold Optimized to Put in Your Desk Drawer However, the best way to learn VIM is not to work on it, but as a regular editor for your daily work. If you're not planning on switching to VIM, it's crap to keep it's original purpose. In this case, go ahead and set up your favorite editor to use Git.
The shortcut for
Save and Exit would be :x If you have multiple files open, you may want to do a :xa
Press i or a to get the selection to enter insert mode, press a few ESC to get out of insert mode, otherwise you may accidentally hit any other mode to save, :wq, :x or ZZ to exit without saving, :q! or ZQ to edit : Reload a file and undo all changes you've made... Press ESC a few times and type :e!.
:q! will force an unconditional exit without saving
This is a page for editing and submission using
nano
. The exit method is:Ctrl + X
然后输入y
Then press Enter to exitIf you want to change the default editor to something else:
Set core.editor in
GIT
configuration: git config --global core.editor "vim"Reference:
http://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits
I tried it, but it didn’t work. Then Baidu went to other methods and posted them:
Press the ESC key to make sure you are not in edit mode and type
:wq
Esc key to make sure you exit insert mode, then: wq (colon W Q) or ZZ (Shift Z Offset-Z).
I can provide you two links that can help you with vim: instead of telling you how you can execute (wq esc) a quick reference card is provided in HTML a quick reference card is provided in PDF format in multiple languages, for printing CodeGo.net, Fold Optimized to Put in Your Desk Drawer However, the best way to learn VIM is not to work on it, but as a regular editor for your daily work. If you're not planning on switching to VIM, it's crap to keep it's original purpose. In this case, go ahead and set up your favorite editor to use Git.
Save and Exit would be
:x
If you have multiple files open, you may want to do a
:xa
Press i or a to get the selection to enter insert mode, press a few ESC to get out of insert mode, otherwise you may accidentally hit any other mode to save, :wq, :x or ZZ to exit without saving, :q! or ZQ to edit : Reload a file and undo all changes you've made... Press ESC a few times and type :e!.
:q! will force an unconditional exit without saving