sontungexpt / buffer-closer

The neovim plugin to auto close unused buffer after retirement time

Home Page:https://sontungexpt.github.io/buffer-closer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

buffer-closer

Features

  • Automatically close inactive buffers after a period of time in minutes or when the new buffer is adding

Installation

-- lazy.nvim
{
    'sontungexpt/buffer-closer',
	event = "VeryLazy",
},

Configuration

-- default values
require("buffer-closer").setup({
	min_remaining_buffers = 2, -- can not be less than 1
	retirement_minutes = 3, -- can not be less than 1

	-- close the buffer when the given events are triggered (see :h autocmd-events)
	-- if the value is "default", the plugin will use the default events
	-- if the value is "disabled", the plugin will not use any events
	-- if the value is a table, the plugin will use the given events
	events = "default", -- (table, "default", "disabled"):

	timed_check = {
		enabled = false,
		interval_minutes = 1, -- can not be less than 1
	},

	excluded = {
		filetypes = { "lazy", "NvimTree", "mason" },
		buftypes = { "terminal", "nofile", "quickfix", "prompt", "help" },
		filenames = {},
	},

	-- it means that a buffer will not be closed if it is opened in a window
	ignore_working_windows = true,
})

Usage

  • This plugin will automatically close inactive buffers after a period of time in minutes or when the new buffer is adding
  • If you want to close all inactive buffers immediately, you can use :BufferCloserRetire command

Similar Plugins

Credits

Thanks

Thanks for inspiration from chrisgrieser

About

The neovim plugin to auto close unused buffer after retirement time

https://sontungexpt.github.io/buffer-closer/

License:GNU General Public License v3.0


Languages

Language:Lua 100.0%