:help :bdelete
Unload buffer but keep as unlisted buffer.
:bdelete
:bd
:.bd
:bd %
:bdelete 3
:bd 3
:bd3
:3bd
:bdelete filename
:bd filename
:bd 2 7 8 13
:%bd
:2,5bd
:5,$bd
:1,.bd
Here %
means all buffers, .
is the current buffer and $
is the last buffer.
We can use the command that closes all buffers (:%bd
) to emulate "close all buffers but the current" by bringing the
current buffer back.
nnoremap <space>D :silent %bd<BAR>e#<CR>