Commit: runtime(doc): Clarify :bd behaviour

0 views
Skip to first unread message

Christian Brabandt

unread,
Feb 13, 2026, 4:01:39 PM (yesterday) Feb 13
to vim...@googlegroups.com
runtime(doc): Clarify :bd behaviour

Commit: https://github.com/vim/vim/commit/48cee53615069e3a5a04be265440180e29f9997a
Author: Christian Brabandt <c...@256bit.org>
Date: Fri Feb 13 20:53:49 2026 +0000

runtime(doc): Clarify :bd behaviour

closes: https://github.com/vim/vim/issues/19389

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 7b8248655..d585669f4 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -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
Reply all
Reply to author
Forward
0 new messages