tbung / nvim-scrollbar

Extensible Neovim Scrollbar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

diagnostics

Features

Requirements

Installation

vim-plug

Plug 'petertriho/nvim-scrollbar'

packer.nvim

use("petertriho/nvim-scrollbar")

Setup

require("scrollbar").setup()

Search

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
    },
})

Example config with tokyonight.nvim colors

local 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

License

MIT

About

Extensible Neovim Scrollbar

License:MIT License


Languages

Language:Lua 100.0%