Skip to content

Repository files navigation

keeper.nvim

Edit your buffer list like text. Keep it across sessions.

GitHub stars License Neovim Lua

An oil.nvim-inspired buffer manager. :Keeper opens your buffers as plain lines in a scratch buffer — delete a line, :w, and the buffer is closed. Your open buffers are saved per directory and restored the next time you start Neovim there.

Important

Formerly scrub.nvim. Update require("scrub")require("keeper") and :Scrub:Keeper.

Features

  • Buffers as text — manage buffers with the motions you already know (dd, visual delete, …)
  • Session persistence — the buffer list is saved on exit, keyed by working directory, and restored on start
  • Zero-config — works out of the box; setup() is optional
  • Lightweight — pure Lua, no dependencies

Install

With lazy.nvim:

{ "n3tw0rth/keeper.nvim", opts = {} }

Any plugin manager works — if you never call setup(), the defaults apply automatically.

Usage

Action Effect
:Keeper Open the buffer list
dd + :w Close the removed buffers
<CR> Jump to the buffer under the cursor
:e Refresh the list
vim.keymap.set("n", "_", "<CMD>Keeper<CR>", { desc = "Open Keeper" })

Configuration

Defaults:

require("keeper").setup({
    -- register the :Keeper command
    enabled = true,

    save_n_restore = {
        -- save the buffer list on exit and restore it on start
        enabled = true,

        -- JSON file the buffer lists are saved to, keyed by cwd
        save_file = vim.fn.stdpath("data") .. "/keeper/buffers.json",
    },
})

Full documentation: :help keeper

License

MIT

About

keeper.nvim is a small, minimal Neovim plugin for managing buffers and restoring them across sessions. It helps you quickly clean up unwanted buffers and automatically brings back your previous buffer list when you reopen Neovim. Inspired by oil.nvim, the focus is simplicity and a lightweight workflow.

Topics

Resources

Stars

35 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages