Delete buffers without disrupting window layout.
If the buffer you want to close has changes, a prompt will be shown to save or discard.
---@class snacks.bufdelete.Opts
---@field buf? number Buffer to delete. Defaults to the current buffer
---@field force? boolean Delete the buffer even if it is modified
---@field filter? fun(buf: number): boolean Filter buffers to delete
---@field wipe? boolean Wipe the buffer instead of deleting it (see `:h :bwipeout`)
---@type fun(buf?: number|snacks.bufdelete.Opts)
Snacks.bufdelete()
Delete all buffers
---@param opts? snacks.bufdelete.Opts
Snacks.bufdelete.all(opts)
Delete a buffer:
- either the current buffer if
buf
is not provided - or the buffer
buf
if it is a number - or every buffer for which
buf
returns true if it is a function
---@param opts? number|snacks.bufdelete.Opts
Snacks.bufdelete.delete(opts)
Delete all buffers except the current one
---@param opts? snacks.bufdelete.Opts
Snacks.bufdelete.other(opts)