{"id":13412831,"url":"https://github.com/petertriho/nvim-scrollbar","last_synced_at":"2025-03-14T18:32:29.544Z","repository":{"id":37389759,"uuid":"445381043","full_name":"petertriho/nvim-scrollbar","owner":"petertriho","description":"Extensible Neovim Scrollbar","archived":false,"fork":false,"pushed_at":"2024-10-17T10:48:52.000Z","size":1895,"stargazers_count":915,"open_issues_count":29,"forks_count":20,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-14T18:19:27.290Z","etag":null,"topics":["lua","neovim","neovim-lua-plugin","neovim-plugin","plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petertriho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-07T03:03:06.000Z","updated_at":"2025-03-14T12:47:46.000Z","dependencies_parsed_at":"2024-01-03T03:32:05.363Z","dependency_job_id":"826a4d56-7896-418c-a864-ef950662f976","html_url":"https://github.com/petertriho/nvim-scrollbar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertriho%2Fnvim-scrollbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertriho%2Fnvim-scrollbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertriho%2Fnvim-scrollbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petertriho%2Fnvim-scrollbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petertriho","download_url":"https://codeload.github.com/petertriho/nvim-scrollbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243625189,"owners_count":20321252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","neovim","neovim-lua-plugin","neovim-plugin","plugin"],"created_at":"2024-07-30T20:01:29.794Z","updated_at":"2025-03-14T18:32:29.157Z","avatar_url":"https://github.com/petertriho.png","language":"Lua","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003envim-scrollbar\u003c/h1\u003e\n  \u003ch5\u003eExtensible Neovim Scrollbar\u003c/h5\u003e\n\u003c/div\u003e\n\n![diagnostics](./assets/diagnostics.gif)\n\n## Features\n\n- ALE\n- Cursor\n- Diagnostics (COC and Native)\n- Git (requires [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim))\n- Search (requires [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens))\n\n## Requirements\n\n- Neovim \u003e= 0.5.1\n- [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens) (optional)\n- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) (optional)\n\n## Installation\n\n[vim-plug](https://github.com/junegunn/vim-plug)\n\n```vim\nPlug 'petertriho/nvim-scrollbar'\n```\n\n[packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse(\"petertriho/nvim-scrollbar\")\n```\n\n## Setup\n\n```lua\nrequire(\"scrollbar\").setup()\n\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eSearch\u003c/summary\u003e\n\n![search](./assets/search.gif)\n\n#### Setup (Packer)\n\n```lua\nuse {\n  \"kevinhwang91/nvim-hlslens\",\n  config = function()\n    -- require('hlslens').setup() is not required\n    require(\"scrollbar.handlers.search\").setup({\n        -- hlslens config overrides\n    })\n  end,\n}\n```\n\nOR\n\n```lua\nuse {\n  \"kevinhwang91/nvim-hlslens\",\n  config = function()\n    require(\"hlslens\").setup({\n       build_position_cb = function(plist, _, _, _)\n            require(\"scrollbar.handlers.search\").handler.show(plist.start_pos)\n       end,\n    })\n\n    vim.cmd([[\n        augroup scrollbar_search_hide\n            autocmd!\n            autocmd CmdlineLeave : lua require('scrollbar.handlers.search').handler.hide()\n        augroup END\n    ]])\n  end,\n}\n```\n\nIf you want to leave only search marks and disable virtual text:\n\n```lua\nrequire(\"scrollbar.handlers.search\").setup({\n    override_lens = function() end,\n})\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eGit Signs\u003c/summary\u003e\n\nhttps://user-images.githubusercontent.com/889383/201331485-477677a7-40a9-4731-998a-34779f7123ff.mp4\n\nDisplay git changes in the sidebar. Requires [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) to be installed.\n\n#### Setup (Packer)\n\n```lua\nuse {\n  \"lewis6991/gitsigns.nvim\",\n  config = function()\n    require('gitsigns').setup()\n    require(\"scrollbar.handlers.gitsigns\").setup()\n  end\n}\n```\n\u003c/details\u003e\n\n## Config\n\n\u003cdetails\u003e\n  \u003csummary\u003eDefaults\u003c/summary\u003e\n\n```lua\nrequire(\"scrollbar\").setup({\n    show = true,\n    show_in_active_only = false,\n    set_highlights = true,\n    folds = 1000, -- handle folds, set to number to disable folds if no. of lines in buffer exceeds this\n    max_lines = false, -- disables if no. of lines in buffer exceeds this\n    hide_if_all_visible = false, -- Hides everything if all lines are visible\n    throttle_ms = 100,\n    handle = {\n        text = \" \",\n        blend = 30, -- Integer between 0 and 100. 0 for fully opaque and 100 to full transparent. Defaults to 30.\n        color = nil,\n        color_nr = nil, -- cterm\n        highlight = \"CursorColumn\",\n        hide_if_all_visible = true, -- Hides handle if all lines are visible\n    },\n    marks = {\n        Cursor = {\n            text = \"•\",\n            priority = 0,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"Normal\",\n        },\n        Search = {\n            text = { \"-\", \"=\" },\n            priority = 1,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"Search\",\n        },\n        Error = {\n            text = { \"-\", \"=\" },\n            priority = 2,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"DiagnosticVirtualTextError\",\n        },\n        Warn = {\n            text = { \"-\", \"=\" },\n            priority = 3,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"DiagnosticVirtualTextWarn\",\n        },\n        Info = {\n            text = { \"-\", \"=\" },\n            priority = 4,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"DiagnosticVirtualTextInfo\",\n        },\n        Hint = {\n            text = { \"-\", \"=\" },\n            priority = 5,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"DiagnosticVirtualTextHint\",\n        },\n        Misc = {\n            text = { \"-\", \"=\" },\n            priority = 6,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"Normal\",\n        },\n        GitAdd = {\n            text = \"┆\",\n            priority = 7,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"GitSignsAdd\",\n        },\n        GitChange = {\n            text = \"┆\",\n            priority = 7,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"GitSignsChange\",\n        },\n        GitDelete = {\n            text = \"▁\",\n            priority = 7,\n            gui = nil,\n            color = nil,\n            cterm = nil,\n            color_nr = nil, -- cterm\n            highlight = \"GitSignsDelete\",\n        },\n    },\n    excluded_buftypes = {\n        \"terminal\",\n    },\n    excluded_filetypes = {\n        \"dropbar_menu\",\n        \"dropbar_menu_fzf\",\n        \"DressingInput\",\n        \"cmp_docs\",\n        \"cmp_menu\",\n        \"noice\",\n        \"prompt\",\n        \"TelescopePrompt\",\n    },\n    autocmd = {\n        render = {\n            \"BufWinEnter\",\n            \"TabEnter\",\n            \"TermEnter\",\n            \"WinEnter\",\n            \"CmdwinLeave\",\n            \"TextChanged\",\n            \"VimResized\",\n            \"WinScrolled\",\n        },\n        clear = {\n            \"BufWinLeave\",\n            \"TabLeave\",\n            \"TermLeave\",\n            \"WinLeave\",\n        },\n    },\n    handlers = {\n        cursor = true,\n        diagnostic = true,\n        gitsigns = false, -- Requires gitsigns\n        handle = true,\n        search = false, -- Requires hlslens\n        ale = false, -- Requires ALE\n    },\n})\n```\n\n\u003c/details\u003e\n\n## Colors/Highlights\n\nColor takes precedence over highlight i.e. if color is defined, that will be\nused to define the highlight instead of highlight.\n\nMark type highlights are in the format of `Scrollbar\u003cMarkType\u003e` and\n`Scrollbar\u003cMarkType\u003eHandle`. If you wish to define these yourself, add\n`set_highlights = false` to the setup.\n\n- `ScrollbarHandle`\n- `ScrollbarCursorHandle`\n- `ScrollbarCursor`\n- `ScrollbarSearchHandle`\n- `ScrollbarSearch`\n- `ScrollbarErrorHandle`\n- `ScrollbarError`\n- `ScrollbarWarnHandle`\n- `ScrollbarWarn`\n- `ScrollbarInfoHandle`\n- `ScrollbarInfo`\n- `ScrollbarHintHandle`\n- `ScrollbarHint`\n- `ScrollbarMiscHandle`\n- `ScrollbarMisc`\n- `ScrollbarGitAdd`\n- `ScrollbarGitAddHandle`\n- `ScrollbarGitChange`\n- `ScrollbarGitChangeHandle`\n- `ScrollbarGitDelete`\n- `ScrollbarGitDeleteHandle`\n\n### Example config with [tokyonight.nvim](https://github.com/folke/tokyonight.nvim) colors\n\n```lua\nlocal colors = require(\"tokyonight.colors\").setup()\n\nrequire(\"scrollbar\").setup({\n    handle = {\n        color = colors.bg_highlight,\n    },\n    marks = {\n        Search = { color = colors.orange },\n        Error = { color = colors.error },\n        Warn = { color = colors.warning },\n        Info = { color = colors.info },\n        Hint = { color = colors.hint },\n        Misc = { color = colors.purple },\n    }\n})\n```\n\n## Custom Handlers\n\nOne can define custom handlers consisting of a name and a lua function that returns a list of marks as follows:\n\n```lua\nrequire(\"scrollbar.handlers\").register(name, handler_function)\n```\n\n`handler_function` receives the buffer number as argument and must return a list of tables with `line`, `text`, `type`, and `level` keys. Only the `line` key is required.\n\n| Key     | Description                                                   |\n| ------- | ------------------------------------------------------------- |\n| `line`  | The line number. _Required_.                                  |\n| `text`  | Marker text. Defaults to global settings depending on `type`. |\n| `type`  | The marker type. Default is `Misc`.                           |\n| `level` | Marker level. Default is `1`.                                 |\n\nE.g. the following marks the first three lines in every buffer.\n\n```lua\nrequire(\"scrollbar.handlers\").register(\"my_marks\", function(bufnr)\n    return {\n        { line = 0 },\n        { line = 1, text = \"x\", type = \"Warn\" },\n        { line = 2, type = \"Error\" }\n    }\nend)\n```\n\n## Acknowledgements\n\n- [kevinhwang91/nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens) for implementation on how to hide search results\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","funding_links":[],"categories":["Scrolling","Lua"],"sub_categories":["Scrollbar"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetertriho%2Fnvim-scrollbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetertriho%2Fnvim-scrollbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetertriho%2Fnvim-scrollbar/lists"}