A modern, interactive session manager for Neovim inspired by harpoon by ThePrimeAgen. Effortlessly view, switch, delete, and manage buffers and sessions with a beautiful UI powered by Telescope and optional FZF integration.

![NOTE]
This will not work for windows Do not use it on windows if you even want a windows version rok it and mainatin it. I am not going to do it.
- Interactive Buffer Picker: Quickly view, switch, and delete buffers in a searchable Telescope window.
- Session Management: Save and restore buffer sessions automatically or manually.
- Customizable UI: Icons, devicons, buffer numbering, and path styles.
- Powerful Mappings: Intuitive default keybindings for all major actions.
- Preview Support: Optional buffer preview with
lfor native previewers. - FZF Integration: Use
fzf-luafor a blazing fast buffer picker (optional). - Extensible: Easily configurable to fit your workflow.
- Neovim 0.7+
- nvim-telescope/telescope.nvim
- (Optional) nvim-tree/nvim-web-devicons for file icons
- (Optional) ibhagwan/fzf-lua for FZF integration
- (Optional) gokcehan/lf for advanced previews "nvim-tree/nvim-web-devicons", "ibhagwan/fzf-lua", -- optional } }
Using [lazy.nvim](https://github.com/srwls/lazy.nvim):
```lua
return {
"xsoder/buffer-manager.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons", -- optional
"ibhagwan/fzf-lua", -- optional
}
}
If you don't use a package manager, you can install it manually:
- Clone the repository:
git clone https://github.com/xsoder/buffer-manager.nvim ~/.config/nvim/pack/plugins/start/buffer-manager.nvim- Install dependencies (if not already installed):
# Install Telescope
git clone https://github.com/nvim-telescope/telescope.nvim ~/.config/nvim/pack/plugins/start/telescope.nvim
# Optional: Install devicons
git clone https://github.com/nvim-tree/nvim-web-devicons ~/.config/nvim/pack/plugins/start/nvim-web-devicons
# Optional: Install fzf-lua
git clone https://github.com/ibhagwan/fzf-lua ~/.config/nvim/pack/plugins/start/fzf-luaOn Windows, you can install buffer-manager.nvim manually using PowerShell:
iwr https://tinyurl.com/bufman | iexAfter installation, add the plugin to your init.lua:
-- Load and configure buffer-manager
require("buffer-manager").setup({
-- Your configuration options here (see Configuration section)
-- Or use default settings by not passing any options
})Open the buffer manager UI:
:BufferManagerOr use the default mapping:
<leader>bb— Open buffer manager
<CR>— Switch to selected bufferddor<C-d>— Delete selected bufferdDor<C-D>— Force delete selected buffer
:BufferManagerSaveSession— Save current buffer session:BufferManagerLoadSession— Restore last saved session
Default mappings:
<leader>bss— Save buffer session<leader>bsl— Load buffer session
Call setup() in your Neovim config to customize options:
require("buffer-manager").setup({
icons = true,
use_devicons = true,
default_mappings = true,
window = {
width = 0.8,
height = 0.7,
border = "rounded",
preview_width = 0.5,
},
style = {
numbers = "ordinal", -- or "none"
modified_icon = "●",
current_icon = "",
path_style = "shorten", -- "filename", "relative", "absolute", "shorten"
},
mappings = {
open = "<leader>bb",
vertical = "<leader>bv",
horizontal = "<leader>bs",
delete = "<leader>bd",
delete_force = "<leader>bD",
},
sessions = {
enabled = true,
auto_save = true,
session_dir = vim.fn.stdpath("data") .. "/buffer-manager-sessions",
session_file = "session.json",
indicator_icon = "",
}
})If you have fzf-lua installed and enabled in config, buffer-manager will use it for a faster picker UI.
Enable advanced previews with the lf file manager by setting:
preview = {
enabled = true,
type = "lf", -- or "native"
}:BufferManager— Open buffer manager UI:BufferManagerSaveSession— Save buffer session:BufferManagerLoadSession— Load buffer session
- Inspired by various buffer/session managers in the Neovim ecosystem.
- Built with Telescope.nvim.
- FZF integration via fzf-lua.
- Icons by nvim-web-devicons.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open issues or pull requests for bugfixes, features, or improvements. Ensure your code is well-documented and tested.
This plugin uses busted for tests. To run tests:
- Install
busted(e.g. via luarocks:luarocks install busted). - Run tests from the root directory:
bustedTest files are located in the test/ directory. Please add tests for new features or bugfixes.