A neovim plugin that displays a vertical indicator showing open buffers.
Jump mode for quick buffer navigation:
- Visual representation of open buffers
- Highlights the currently active buffer
- Jump mode for quick buffer navigation by typing characters
- Configurable positioning and appearance
- Transparent background support
- Persists highlight configuration across colorscheme changes
Using lazy.nvim:
{
"ahkohd/buffer-sticks.nvim",
config = function()
require("buffer-sticks").setup()
end,
}Using packer.nvim:
use {
"ahkohd/buffer-sticks.nvim",
config = function()
require("buffer-sticks").setup()
end
}return {
"ahkohd/buffer-sticks.nvim",
event = "VeryLazy",
keys = {
{
"<leader>j",
function()
BufferSticks.jump()
end,
desc = "Buffer jump mode",
},
},
config = function()
local sticks = require("buffer-sticks")
sticks.setup({
filter = { buftypes = { "terminal" } },
highlights = {
active = { link = "Statement" },
inactive = { link = "Whitespace" },
active_modified = { link = "Constant" },
inactive_modified = { link = "Constant" },
label = { link = "Comment" },
},
})
sticks.show()
end,
}require("buffer-sticks").setup({
offset = { x = 0, y = 0 }, -- Position offset (positive moves inward from right edge)
padding = { top = 0, right = 1, bottom = 0, left = 1 }, -- Padding inside the float
active_char = "──", -- Character for active buffer
inactive_char = " ─", -- Character for inactive buffers
active_modified_char = "──", -- Character for active modified buffer (unsaved changes)
inactive_modified_char = " ─", -- Character for inactive modified buffers (unsaved changes)
transparent = true, -- Remove background color (shows terminal/editor background)
auto_hide = true, -- Auto-hide when cursor is over float (default: true)
label = { show = "jump" }, -- Label display: "always", "jump", or "never"
jump = { show = { "filename", "space", "label" } }, -- Jump mode display options
-- winblend = 100, -- Window blend level (0-100, 0=opaque, 100=fully blended)
-- filter = {
-- filetypes = { "help", "qf" }, -- Exclude by filetype (also: "NvimTree", "neo-tree", "Trouble")
-- buftypes = { "terminal" }, -- Exclude by buftype (also: "help", "quickfix", "nofile")
-- names = { ".*%.git/.*", "^/tmp/.*" }, -- Exclude buffers matching lua patterns
-- },
highlights = {
active = { fg = "#bbbbbb" },
inactive = { fg = "#333333" },
active_modified = { fg = "#ffffff" },
inactive_modified = { fg = "#999999" },
label = { fg = "#aaaaaa", italic = true }
}
})-- Toggle visibility
BufferSticks.toggle()
-- Show
BufferSticks.show()
-- Hide
BufferSticks.hide()
-- Enter jump mode to navigate by typing
BufferSticks.jump()Jump mode allows you to quickly navigate to buffers by typing their first character(s):
- Call
BufferSticks.jump() - Type the first character of the buffer you want to jump to
- If multiple buffers match, continue typing more characters
- Press
EscorCtrl-Cto cancel
Label Display Options:
label = { show = "always" }- Always show buffer name labelslabel = { show = "jump" }- Only show labels when in jump mode (default)label = { show = "never" }- Never show labels
Jump Mode Display Options:
- Default:
jump = { show = { "filename", "space", "label" } }
Available elements:
"filename"- Full filename"space"- Spaces between elements"label"- Unique character"stick"- Active/inactive character
You can use hex colors:
highlights = {
active = { fg = "#bbbbbb" },
inactive = { fg = "#333333" },
active_modified = { fg = "#ffffff" },
inactive_modified = { fg = "#999999" },
label = { fg = "#aaaaaa", italic = true }
}Or link to existing highlight groups:
highlights = {
active = { link = "Statement" },
inactive = { link = "Whitespace" },
active_modified = { link = "Constant" },
inactive_modified = { link = "Constant" },
label = { link = "Comment" },
}setup(opts)- Initialize the plugin with configurationtoggle()- Toggle buffer sticks visibilityshow()- Show buffer stickshide()- Hide buffer sticksjump()- Enter jump mode for quick buffer navigation