Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/chrisgrieser/nvim-early-retirement

Send buffers into early retirement by automatically closing them after x minutes of inactivity.
https://github.com/chrisgrieser/nvim-early-retirement

buffer-management neovim-plugin

Last synced: about 2 months ago
JSON representation

Send buffers into early retirement by automatically closing them after x minutes of inactivity.

Lists

README

        

# nvim-early-retirement 👴👵


badge

Send buffers into early retirement by automatically closing them after x minutes
of inactivity.

Makes the bufferline or `:bnext` less crowded.

- [Installation](#installation)
- [Configuration](#configuration)
- [Similar Plugins](#similar-plugins)
- [Credits](#credits)

## Installation

```lua
-- packer
use {
"chrisgrieser/nvim-early-retirement",
config = function () require("early-retirement").setup() end,
}

-- lazy.nvim
{
"chrisgrieser/nvim-early-retirement",
config = true,
event = "VeryLazy",
},
```

## Configuration

```lua
defaultOpts = {
-- If a buffer has been inactive for this many minutes, close it.
retirementAgeMins = 20,

-- Filetypes to ignore.
ignoredFiletypes = {},

-- Ignore files matching this lua pattern; empty string disables this setting.
ignoreFilenamePattern = "",

-- Will not close the alternate file.
ignoreAltFile = true,

-- Minimum number of open buffers for auto-closing to become active. E.g.,
-- by setting this to 4, no auto-closing will take place when you have 3
-- or fewer open buffers. Note that this plugin never closes the currently
-- active buffer, so a number < 2 will effectively disable this setting.
minimumBufferNum = 1,

-- Ignore buffers with unsaved changes. If false, the buffers will
-- automatically be written and then closed.
ignoreUnsavedChangesBufs = true,

-- Ignore non-empty buftypes, for example terminal buffers
ignoreSpecialBuftypes = true,

-- Ignore visible buffers. Buffers that are open in a window or in a tab
-- are considered visible by vim. ("a" in `:buffers`)
ignoreVisibleBufs = true,

-- ignore unloaded buffers. Session-management plugin often add buffers
-- to the buffer list without loading them.
ignoreUnloadedBufs = false,

-- Show notification on closing. Works with plugins like nvim-notify.
notificationOnAutoClose = false,

-- When a file is deleted, for example via an external program, delete the
-- associated buffer as well.
-- (This feature is independent from the automatic closing)
deleteBufferWhenFileDeleted = false,
}
```

> [!NOTE]
> You can also have `nvim-early-retirement` ignore certain buffers by setting
> `vim.b.ignore_early_retirement = true`.

## Similar Plugins
- Close unedited files: [hbac](https://github.com/axkirillov/hbac.nvim)

## Credits
__Thanks__
To `@nikfp` and `@xorg-dogma` on Discord for their help.

__About Me__
In my day job, I am a sociologist studying the social mechanisms underlying the
digital economy. For my PhD project, I investigate the governance of the app
economy and how software ecosystems manage the tension between innovation and
compatibility. If you are interested in this subject, feel free to get in touch.

__Blog__
I also occasionally blog about vim: [Nano Tips for Vim](https://nanotipsforvim.prose.sh)

__Profiles__
- [Discord](https://discordapp.com/users/462774483044794368/)
- [Academic Website](https://chris-grieser.de/)
- [GitHub](https://github.com/chrisgrieser/)
- [Twitter](https://twitter.com/pseudo_meta)
- [ResearchGate](https://www.researchgate.net/profile/Christopher-Grieser)
- [LinkedIn](https://www.linkedin.com/in/christopher-grieser-ba693b17a/)

Buy Me a Coffee at ko-fi.com