runtime(doc): Clarify :bd behaviour

closes: #19389

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-02-13 20:53:49 +00:00
parent c5f312aad8
commit 48cee53615
+10 -3
View File
@@ -1,4 +1,4 @@
*windows.txt* For Vim version 9.1. Last change: 2025 Dec 03
*windows.txt* For Vim version 9.1. Last change: 2026 Feb 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1210,15 +1210,22 @@ list of buffers. |unlisted-buffer|
:bd[elete][!] [N]
Unload buffer [N] (default: current buffer) and delete it from
the buffer list. If the buffer was changed, this fails,
unless when [!] is specified, in which case changes are lost.
unless [!] is specified, in which case changes are lost.
The file remains unaffected. Any windows for this buffer are
closed. If buffer [N] is the current buffer, another buffer
will be displayed instead. This is the most recent entry in
the jump list that points into a loaded buffer.
Actually, the buffer isn't completely deleted, it is removed
from the buffer list |unlisted-buffer| and option values,
variables and mappings/abbreviations for the buffer are
cleared. Examples: >
cleared. If [N] is the last listed buffer in a window (i.e.,
there is no other listed buffer to switch to), the buffer is
emptied instead of being unloaded. The window is not closed,
and the buffer may be reused as a new buffer |buffer-reuse|.
This ensures every window always has a valid buffer.
Examples: >
:.,$-bdelete " delete buffers from the current one to
" last but one
:%bdelete " delete all buffers