Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1563771179
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (25 sloc) 1.488 kb
<h3 id="quitting-vim">Quitting Vim</h3>
<p>You've finished using Vim and now you want to close the program.</p>
<p>To save the changes in the current file then quit use <tt>:x</tt><span
class="fn">The more usual suggestion for saving then quiting is
<tt>:wq</tt>. We use <tt>:x</tt> here because it only saves the file if it
has been changed, thus preserving its timestamp and saving needless disk
access.</span>. In Normal mode you use <kbd>ZZ</kbd>.</p>
<p>The way you quit Vim depends on what you want to quit (the whole program,
or just the current window) and what you want to do with your unsaved
<p>As mentioned above, if you're using a single window either <tt>:x</tt> or
<kbd>ZZ</kbd> will save any unsaved changes, and exit Vim. </p>
<p>To exit and discard your changes you use <tt>:q!</tt> (mnemonic:
<b>q</b>uit in a possibly dangerous (exclamatory) manner). </p>
<p>You can also quit on the condition that there are no unsaved changes with
<tt>:q</tt>; if you do need to save Vim warns you <samp>E37: No write since
last change (add ! to override)</samp>.</p>
<p>If you're using multiple windows the above commands will act upon the
current window. To quit all windows use <tt>:qa</tt> (mnemonic: <b>q</b>uit
<b>a</b>ll). Vim will prompt you to save any changes. To quit all windows
without saving use <tt>:qa!</tt> (mnemonic: <b>q</b>uit <b>a</b>ll in a
possibly dangerous manner).</p>
Jump to Line
Something went wrong with that request. Please try again.