A lightweight Neovim plugin that displays a scrollbar-like indicator for your current position in the buffer.
- Minimalist, scrollbar-like indicator in a floating window.
- Appears after a configurable delay of cursor inactivity.
- Highly customizable:
- Position (left/right), width, and margins.
- Window height (percentage of screen).
- Characters and highlights for active and inactive states.
- Line spacing for a sparser look.
- Disappears automatically on cursor movement.
Install with your favorite plugin manager.
{
"aikawa9376/buffer-position.nvim",
config = function()
require("buffer-position").setup({
-- your custom config
})
end,
}
use {
"aikawa9376/buffer-position.nvim",
config = function()
require("buffer-position").setup()
end,
}
The plugin comes with the following default configuration. You can override any of these values in the setup()
function.
{
position = "right", -- "left" or "right"
width = 2,
offset = { x = -1, y = 0 },
height_percentage = 0.8,
active_char = "──",
inactive_char = " ─",
transparent = true,
line_spacing = 1, -- number of blank lines between characters
show_delay = 1000,
hide_delay = 1000, -- ms
auto_hide = false,
highlights = {
active = { fg = "#ffffff" },
inactive = { fg = "#505050" },
},
}
position
("left"
or"right"
): Position of the indicator on the screen.width
(number
): Width of the floating window.offset
(table
): Fine-tune the window position withx
andy
offsets.height_percentage
(number
): Height of the window as a percentage of screen height (0.0 to 1.0).active_char
(string
): Character to display for the current position.inactive_char
(string
): Character to display for the rest of the track.transparent
(boolean
): Whether the window background should be transparent.line_spacing
(number
): Number of blank lines to insert between indicator characters.show_delay
(number
): Delay in milliseconds afterCursorHold
before showing the indicator.auto_hide
(boolean
): Iftrue
, automatically hides the indicator afterhide_delay
. Iffalse
, it only hides onCursorMoved
.hide_delay
(number
): Delay in milliseconds before hiding the indicator (only ifauto_hide
istrue
).highlights
(table
): Configure the highlight groups foractive
andinactive
states. You can setfg
,bg
,bold
,italic
, orlink
to an existing highlight group.
This plugin is heavily inspired by ahkohd/buffer-sticks.nvim.
This plugin is licensed under the MIT License.