Home Explore Blog CI



neovim

17th chunk of `runtime/doc/windows.txt`
0e2a2116529d68b51e5bbd57303ef612603fcc85a0f542020000000100000fa3
 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: >
                    :.,$-bdelete   "delete buffers from the current one to
                                   " last but one
                    :%bdelete      " delete all buffers
<
:bdelete[!] {bufname}						*E93* *E94*
		Like ":bdelete[!] [N]", but buffer given by name, see
		|{bufname}|.

:bdelete[!] N1 N2 ...
		Do ":bdelete[!]" for buffer N1, N2, etc.  The arguments can be
		buffer numbers or buffer names (but not buffer names that are
		a number).  Insert a backslash before a space in a buffer
		name.

:N,Mbdelete[!]	Do ":bdelete[!]" for all buffers in the range N to M
		|inclusive|.

:[N]bw[ipeout][!]			*:bw* *:bwipe* *:bwipeout* *E517*
:bw[ipeout][!] {bufname}
:N,Mbw[ipeout][!]
:bw[ipeout][!] N1 N2 ...
		Like |:bdelete|, but really delete the buffer.  Everything
		related to the buffer is lost.  All marks in this buffer
		become invalid, option settings are lost, the jumplist and
		tagstack data will be purged, etc.  Don't use this
		unless you know what you are doing. Examples: >
		    :.+,$bwipeout   " wipe out all buffers after the current
				    " one
		    :%bwipeout	    " wipe out all buffers
<
:[N]bun[load][!]				*:bun* *:bunload* *E515*
:bun[load][!] [N]
		Unload buffer [N] (default: current buffer).  The memory
		allocated for this buffer will be freed.  The buffer remains
		in the buffer list.
		If the buffer was changed, this fails, unless when [!] is
		specified, in which case the changes are lost.
		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.

:bunload[!] {bufname}
		Like ":bunload[!] [N]", but buffer given by name.
		Also see |{bufname}|.

:N,Mbunload[!]	Do ":bunload[!]" for all buffers in the range N to M
		|inclusive|.

:bunload[!] N1 N2 ...
		Do ":bunload[!]" for buffer N1, N2, etc.  The arguments can be
		buffer numbers or buffer names (but not buffer names that are
		a number).  Insert a backslash before a space in a buffer
		name.

:[N]b[uffer][!] [+cmd] [N]		*:b* *:bu* *:buf* *:buffer* *E86*
		Edit buffer [N] from the buffer list.  If [N] is not given,
		the current buffer remains being edited.  See |:buffer-!| for
		[!].  This will also edit a buffer that is not in the buffer
		list, without setting the 'buflisted' flag.
		Also see |+cmd|.

:[N]b[uffer][!] [+cmd] {bufname}				*{bufname}*
		Edit buffer for {bufname} from the buffer list.  A partial
		name also works, so long as it is unique in the list of
		buffers.
		Note that a buffer whose name is a number cannot be referenced
		by that name; use the buffer number instead.  Same is true if
		the buffer name starts with a `+`, it will be interpreted as
		the start of a |+cmd|.
		Insert a backslash before a space in a buffer name.
		See |:buffer-!| for [!].
		This will also edit a buffer that is not in the buffer list,
		without setting the 'buflisted' flag.
		Also see |+cmd|.

:[N]sb[uffer] [+cmd] [N]				*:sb* *:sbuffer*
		Split window and edit buffer [N] from the buffer list.  If [N]
		is not given, the current buffer is edited.  Respects the
		"useopen" setting of 'switchbuf' when splitting.  This will
		also edit a buffer that is not in the buffer list, without
		setting the 'buflisted' flag.
		Also see |+cmd|.

:[N]sb[uffer] [+cmd] {bufname}
		Split window and edit buffer for |{bufname}| from the buffer
		list.  This will also edit a buffer that is not in the buffer
		list, without setting the 'buflisted' flag.
		Note: If what you want to do is split the

Title: Buffer Manipulation Commands: Wipeout, Unload, Edit
Summary
This section details further buffer management commands in Vim. It elaborates on `:bdelete` (buffer delete), clarifying that while it removes a buffer from the list and clears settings, the underlying file remains untouched. It then introduces `:bwipeout` (buffer wipeout), which completely deletes a buffer and all related data. Additionally, it covers `:bunload` (buffer unload), which frees the memory allocated to a buffer while keeping it in the buffer list. Finally, it describes the various forms of the `:buffer` and `:sbuffer` commands, which are used to edit buffers (either in the current window or a split window) by number or name, even those not currently listed, and explains how to handle buffer names with spaces or numeric names.