A minimal, performant lua-based buffer line for neovim with mouse support
- π Excellent Performance: Aggressive caching and debouncing for smooth operation even with 100+ buffers
- π±οΈ Mouse Support: Click to switch buffers, click close button to close buffers
- β¨οΈ Buffer Navigation: Commands for next/previous buffer and jump to buffer by index
- π¨ Clean & Minimal: Simple, distraction-free design
- β‘ Smart Truncation: Automatically handles many buffers with overflow indicators
- π― Buffer Count Display: Optional buffer count indicator (e.g., "3/10")
- Requires neovim version >= 0.10
vim.opt.showtabline=2in your init.lua for bufferline- Have a nerd font installed
{
"abhilash26/zenbufline.nvim",
event = { "BufReadPost", "BufNewFile" },
opts = {}
},{ "abhilash26/zenbufline.nvim",
config = function()
require("zenbufline").setup()
end
};require("zenbufline").setup()require("zenbufline").setup({
line_start = "",
line_end = "",
modified = " [+] ",
hl = "ZenbuflineBuffer",
left = {
hl = "ZenbuflineNormal",
icon = "",
},
right = {
hl = "ZenbuflineNormal",
icon = "",
},
active = {
hl = "ZenbuflineActive",
italic = false,
bold = true,
},
inactive = {
hl = "ZenBuflineInactive",
italic = true,
bold = false,
},
-- Performance options
debounce_ms = 15, -- Debounce time for updates (lower = more responsive, higher = better performance)
-- Mouse support
show_close_button = true, -- Show clickable close button
close_icon = "Γ", -- Icon for close button
force_close_modified = false, -- Force close modified buffers without warning
-- Display options
max_visible_buffers = 0, -- Max buffers to show (0 = no limit)
show_buffer_count = false, -- Show buffer count on right side
})- Left Click on buffer name: Switch to that buffer
- Left Click on
Γbutton: Close that buffer
The plugin exposes the following functions for buffer navigation:
local zenbufline = require("zenbufline")
-- Navigate to next buffer
zenbufline.next_buffer()
-- Navigate to previous buffer
zenbufline.prev_buffer()
-- Jump to specific buffer by index (1-9)
zenbufline.goto_buffer(3) -- Jump to 3rd buffer
-- Close current buffer intelligently (switches to next before closing)
zenbufline.close_current_buffer()Add these to your config to enable keyboard navigation:
-- Buffer navigation
vim.keymap.set('n', '<Tab>', function() require('zenbufline').next_buffer() end, { desc = 'Next buffer' })
vim.keymap.set('n', '<S-Tab>', function() require('zenbufline').prev_buffer() end, { desc = 'Previous buffer' })
-- Close current buffer
vim.keymap.set('n', '<leader>bc', function() require('zenbufline').close_current_buffer() end, { desc = 'Close buffer' })
-- Jump to specific buffer (1-9)
for i = 1, 9 do
vim.keymap.set('n', '<leader>' .. i, function() require('zenbufline').goto_buffer(i) end, { desc = 'Go to buffer ' .. i })
end- Buffer Caching: Maintains efficient buffer list cache, only rebuilding when necessary
- Debouncing: Batches rapid updates to avoid excessive redraws (configurable via
debounce_ms) - Smart Updates: Only updates affected buffers instead of rebuilding entire tabline
- Memory Efficient: ~1KB per buffer with aggressive caching
- β <0.5ms update time for 10 buffers
- β <2ms update time for 100 buffers
- β Max 60-100 updates/second (debounced)
- β No perceivable lag during normal operations
require("zenbufline").setup({
show_close_button = false,
})Useful when you have many buffers open:
require("zenbufline").setup({
max_visible_buffers = 10, -- Shows up to 10 buffers centered on current
})require("zenbufline").setup({
show_buffer_count = true, -- Shows "3/10" at the right
})require("zenbufline").setup({
debounce_ms = 5, -- More responsive but slightly higher CPU
-- or
debounce_ms = 30, -- Better battery life, still very smooth
})zenbufline.nvim follows a minimalist philosophy:
- π― Focus on core functionality: Buffer display and navigation
- π Performance first: Every line of code is optimized
- π§ Minimal visual noise: Clean, distraction-free interface
- π§ Highly configurable: But sane defaults out of the box
We explicitly do not support:
- β Buffer groups/tabs
- β Per-filetype icons
- β LSP diagnostics integration
- β Git status indicators
- β Complex animations
If you need these features, consider barbar.nvim or bufferline.nvim.
Make sure you have set mouse=a in your config.
Ensure vim.opt.showtabline=2 is set in your init.lua.
Check that your font supports the Γ character or change the close_icon option.
Contributions are welcome! Please keep the minimalist philosophy in mind:
- Focus on performance improvements
- Keep code simple and maintainable
- Add features only if they benefit 80%+ of users
MIT License - see LICENSE for details
