Vim has opened multiple labels, how to exit directly and quickly?

  question, vim


Don’t want to close one by one, how to exit quickly?

Give you a quick way to find your own answer:

  1. Vim command line mode

: help quit then Ctrl+d, as shown in the figure below, the keyword of the help document appears, then, complete your own search, Enter.


  1. The detailed documentation of quit will appear as follows:

Omit 3,856 English characters here ... take a look down and you will find the key command qa. quit all. but my files need to be saved. what should I do?  Keep looking down.
 *:qa* *:qall*
 :qa[ll]        Exit Vim, unless there are some buffers which have been
 changed.  (Use ":bmod" to go to the next modified buffer).
 When 'autowriteall' is set all changed buffers will be
 written, like |:wqall|. {not in Vi}
 :conf[irm] qa[ll]
 Exit Vim.  Bring up a prompt when some buffers have been
 changed.  See |:confirm|. {not in Vi}
 :qa[ll]!  Exit Vim.  Any changes to buffers are lost. {not in Vi}
 Also see |:cquit|, it does the same but exits with a non-zero
 Omit a large string of English characters here ... wqa found!  Before quitting, save it. Even xa!
 :wqa[ll]!  [++opt]
 :xa[ll]!  Write all changed buffers, even the ones that are readonly,
 and exit Vim.  If there are buffers without a file name or
 which cannot be written for another reason, Vim will not quit.
 {not in Vi}

Learn to check help documents, which is a basic skill for learning linux. At the same time, do other things, first see if there are any help documents or something like that.

Learning knowledge is infinite, but learning methods are limited.