Theming & Highlights

nvim-scrollbar automatically attempts to match your current color scheme. However, you can fully customize the colors and highlights.

Highlight Groups

The plugin uses the following highlight groups. Mark type highlights are in the format Scrollbar<MarkType> and Scrollbar<MarkType>Handle.

  • ScrollbarHandle: The main scrollbar track.
  • ScrollbarCursor, ScrollbarCursorHandle
  • ScrollbarSearch, ScrollbarSearchHandle
  • ScrollbarError, ScrollbarErrorHandle
  • ScrollbarWarn, ScrollbarWarnHandle
  • ScrollbarInfo, ScrollbarInfoHandle
  • ScrollbarHint, ScrollbarHintHandle
  • ScrollbarMisc, ScrollbarMiscHandle
  • ScrollbarGitAdd, ScrollbarGitAddHandle
  • ScrollbarGitChange, ScrollbarGitChangeHandle
  • ScrollbarGitDelete, ScrollbarGitDeleteHandle

Customizing Colors

You can define colors in the setup() function. The configuration takes precedence: color > highlight.

Example: Tokyo Night

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

If you prefer to manage highlights yourself globally (e.g., in your colors/ file), set set_highlights = false in the setup configuration.