Home

Awesome

nvim-bufdel

A small Neovim plugin to improve the deletion of buffers.

Improvements:

demo

Here the same buffer is displayed in left and top-right window. Deleting that buffer preserves the window layout and the first buffer with a number greater than the deleted one is selected instead (the one immediately to the right in the bufferline).

Installation

With packer.nvim:

use {'ojroques/nvim-bufdel'}

With paq-nvim:

paq {'ojroques/nvim-bufdel'}

Usage

Delete the current buffer:

:BufDel

Delete the current buffer and ignore changes:

:BufDel!

Delete a buffer by its name or number (use quotes in case the buffer name is a number):

:BufDel <bufexpr>

Delete all listed buffers (add ! to ignore changes):

:BufDelAll

Delete all listed buffers except the current one (add ! to ignore changes):

:BufDelOthers

Configuration

You can pass options to the setup() function. Here are the default options:

require('bufdel').setup {
  next = 'tabs',
  quit = true,  -- quit Neovim when last buffer is closed
}

The next option determines the next buffer to display after deletion. Supported values: