nvim-scrollbar
Extensible Neovim Scrollbar
🚧 WORK IN PROGRESS 🚧
This is a work in progress and breaking changes to the setup/config could occur in the future. Sorry for any inconveniences.
Features
- Diagnostics
- Search (requires nvim-hlslens)
Requirements
- Neovim >= 0.5.1
- nvim-hlslens (optional)
Installation
Plug 'petertriho/nvim-scrollbar'
use("petertriho/nvim-scrollbar")
Setup
require("scrollbar").setup()
Search
Run after loading hlslens
require("scrollbar.handlers.search").setup()
Config
Defaults
require("scrollbar").setup({
show = true,
handle = {
text = " ",
color = "white",
hide_if_all_visible = true, -- Hides handle if all lines are visible
},
marks = {
Search = { text = { "-", "=" }, priority = 0, color = "orange" },
Error = { text = { "-", "=" }, priority = 1, color = "red" },
Warn = { text = { "-", "=" }, priority = 2, color = "yellow" },
Info = { text = { "-", "=" }, priority = 3, color = "blue" },
Hint = { text = { "-", "=" }, priority = 4, color = "green" },
Misc = { text = { "-", "=" }, priority = 5, color = "purple" },
},
excluded_filetypes = {
"",
"prompt",
"TelescopePrompt",
},
autocmd = {
render = {
"BufWinEnter",
"TabEnter",
"TermEnter",
"WinEnter",
"CmdwinLeave",
"TextChanged",
"VimResized",
"WinScrolled",
},
},
handlers = {
diagnostic = true,
search = false, -- Requires hlslens to be loaded
},
})
tokyonight.nvim colors
Example config withlocal colors = require("tokyonight.colors").setup()
require("scrollbar").setup({
handle = {
color = colors.bg_highlight,
},
marks = {
Search = { color = colors.orange },
Error = { color = colors.error },
Warn = { color = colors.warning },
Info = { color = colors.info },
Hint = { color = colors.hint },
Misc = { color = colors.purple },
}
})
Acknowledgements
- kevinhwang91/nvim-hlslens for implementation on how to hide search results