Unable to close many buffers by one command in Vim
The :bufdo
command lets you execute a command on all buffers. In this case, you want to run :bufdo bdelete
to close all open buffers in one go.
:qall
or :qa
will close all windows
:%bd(elete)
I think this is what you asking for
:on
will close all buffers except the one you are currently editing (the cursor is inside this buffer).
:on!
will also close modified buffers but these will become hidden buffers.
:ls
will lists all the buffers with their status (hidden, ...)
Some help:
:h only
:h hidden-buffer
:h ls