
vi - How do I exit Vim? - Stack Overflow
2017年5月24日 · :q - quit :q! - quit without saving :wq - save & quit or write & quit :wq! - same as wq, but force write in case file permissions are readonly :x - write & quit :qa - quit all. useful …
root - :wq! command in vim - Stack Overflow
2018年9月10日 · Recently, I read here about the :wq! command in vim. I don't understand how it can force-write a file without write permissions. This way, theoretically, one would be able to …
What's the use of the exclamation mark ('!') in Vim's command line ...
2010年6月22日 · The ! qualifier tells Vim to force the operation. For example, if the file was read-only you would use :w! to write it anyway. If the file was modified and you wanted to quit …
What does :wq stand for in Vim? - Stack Overflow
2017年3月10日 · Note that ZZ doesn't do exactly the same as :wq: the latter always saves before quitting, while the former only writes the file when there are unsaved changes. – L3viathan …
vim - How do I exit from the text window in Git? - Stack Overflow
2012年2月8日 · In vim, you can press i to start entering text and save by pressing esc and :wq and enter, this will commit with the message you typed. In your current state, to just come out …
Trying to Commit with vim. <esc> :wq not working?
2015年5月8日 · It looks like your Vim is in easy mode, emulating other modeless editors. See :help easy. To quit in this mode, use Ctrl + O followed by :wq Enter. You could also turn off …
How to exit the Vim editor when :q or :x doesn't work
2017年11月15日 · :wq will attempt to save and quit, but won't quit if it can't save.:wq! will attempt to save, and then quit whether or not it can save. E: Credit to @GregoryNisbet for reminding …
save - Difference between wq and x in vi - Stack Overflow
2012年12月12日 · I always using :wq to save a file. Today, I came to know that :x can be used to do that. But I didn't notice it in any vi-tutorial or vi-quick-reference. Is there any difference …
How does the Vim "write with sudo" trick work? - Stack Overflow
2010年4月8日 · So, this nifty command :w !sudo tee % is like a little workaround for when you realize you forgot to open Vim with the all-powerful sudo. Let's break it down::w is Vim's way of …
Is it possible to remap ‘wq’ to save and close the current buffer ...
Vim allows the user to add key mappings for commands in all modes, including the Command-line mode, so one can define the following mappings (in one’s .vimrc file)::cnoreabbrev wq …