All Projects → petertriho → nvim-scrollbar

petertriho / nvim-scrollbar

Licence: MIT license
Extensible Neovim Scrollbar

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to nvim-scrollbar

agitator.nvim
No description or website provided.
Stars: ✭ 16 (-95.49%)
Mutual labels:  neovim-plugin, neovim-lua-plugin
winshift.nvim
Rearrange your windows with ease.
Stars: ✭ 230 (-35.21%)
Mutual labels:  neovim-plugin, neovim-lua-plugin
awesome-neovim
Awesome Configurations for C/C++,Zig,Web and Lua development in NeoVim
Stars: ✭ 54 (-84.79%)
Mutual labels:  neovim-plugin, neovim-lua-plugin
diffview.nvim
Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Stars: ✭ 1,472 (+314.65%)
Mutual labels:  neovim-plugin, neovim-lua-plugin
denops-docker.vim
Manage Docker in Vim/Neovim
Stars: ✭ 48 (-86.48%)
Mutual labels:  neovim-plugin
cargo-limit
Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc.
Stars: ✭ 105 (-70.42%)
Mutual labels:  neovim-plugin
godo
(Neo)Vim plugin to navigate todos in Go projects with ease
Stars: ✭ 13 (-96.34%)
Mutual labels:  neovim-plugin
code runner.nvim
Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Stars: ✭ 234 (-34.08%)
Mutual labels:  neovim-plugin
AbbrevMan.nvim
🍍 A NeoVim plugin for managing vim abbreviations.
Stars: ✭ 82 (-76.9%)
Mutual labels:  neovim-plugin
denops-gh.vim
Vim/Neovim plugin for GitHub
Stars: ✭ 27 (-92.39%)
Mutual labels:  neovim-plugin
dial.nvim
enhanced increment/decrement plugin for Neovim.
Stars: ✭ 364 (+2.54%)
Mutual labels:  neovim-plugin
tabby.nvim
A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
Stars: ✭ 232 (-34.65%)
Mutual labels:  neovim-plugin
vim-tips-wiki
1500+ tips downloaded from Vim Tips Wiki, parsed and formatted to look and work like native Vim help files
Stars: ✭ 56 (-84.23%)
Mutual labels:  neovim-plugin
which-key.nvim
💥 Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
Stars: ✭ 2,043 (+475.49%)
Mutual labels:  neovim-plugin
navigator.lua
Source code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐. Exploring LSP and 🌲Treesitter symbols a piece of 🍰. Take control like a boss 🦍.
Stars: ✭ 781 (+120%)
Mutual labels:  neovim-plugin
neovim-lua-plugin-boilerplate
Starter template for creating Neovim Lua plugins
Stars: ✭ 28 (-92.11%)
Mutual labels:  neovim-plugin
nvim-highlite
A colorscheme template that is "lite" on logic for the developer.
Stars: ✭ 163 (-54.08%)
Mutual labels:  neovim-plugin
42header.vim
Add and update the 42 comment header at the top of your files
Stars: ✭ 15 (-95.77%)
Mutual labels:  neovim-plugin
vim-counterpoint
Cycle between file counterparts in vim or neovim.
Stars: ✭ 12 (-96.62%)
Mutual labels:  neovim-plugin
deoplete-solargraph
deoplete.nvim source for Ruby with solargraph.
Stars: ✭ 73 (-79.44%)
Mutual labels:  neovim-plugin

nvim-scrollbar

Extensible Neovim Scrollbar

diagnostics

Features

Requirements

Installation

vim-plug

Plug 'petertriho/nvim-scrollbar'

packer.nvim

use("petertriho/nvim-scrollbar")

Setup

require("scrollbar").setup()

Search

search

If you also want to configure hlslens, add the following to your setup:

require("scrollbar.handlers.search").setup()

OR

require("hlslens").setup({
   build_position_cb = function(plist, _, _, _)
        require("scrollbar.handlers.search").handler.show(plist.start_pos)
   end,
})

vim.cmd([[
    augroup scrollbar_search_hide
        autocmd!
        autocmd CmdlineLeave : lua require('scrollbar.handlers.search').handler.hide()
    augroup END
]])

Config

Defaults
require("scrollbar").setup({
    show = true,
    show_in_active_only = false,
    set_highlights = true,
    folds = 1000, -- handle folds, set to number to disable folds if no. of lines in buffer exceeds this
    max_lines = false, -- disables if no. of lines in buffer exceeds this
    handle = {
        text = " ",
        color = nil,
        cterm = nil,
        highlight = "CursorColumn",
        hide_if_all_visible = true, -- Hides handle if all lines are visible
    },
    marks = {
        Search = {
            text = { "-", "=" },
            priority = 0,
            color = nil,
            cterm = nil,
            highlight = "Search",
        },
        Error = {
            text = { "-", "=" },
            priority = 1,
            color = nil,
            cterm = nil,
            highlight = "DiagnosticVirtualTextError",
        },
        Warn = {
            text = { "-", "=" },
            priority = 2,
            color = nil,
            cterm = nil,
            highlight = "DiagnosticVirtualTextWarn",
        },
        Info = {
            text = { "-", "=" },
            priority = 3,
            color = nil,
            cterm = nil,
            highlight = "DiagnosticVirtualTextInfo",
        },
        Hint = {
            text = { "-", "=" },
            priority = 4,
            color = nil,
            cterm = nil,
            highlight = "DiagnosticVirtualTextHint",
        },
        Misc = {
            text = { "-", "=" },
            priority = 5,
            color = nil,
            cterm = nil,
            highlight = "Normal",
        },
    },
    excluded_buftypes = {
        "terminal",
    },
    excluded_filetypes = {
        "prompt",
        "TelescopePrompt",
    },
    autocmd = {
        render = {
            "BufWinEnter",
            "TabEnter",
            "TermEnter",
            "WinEnter",
            "CmdwinLeave",
            "TextChanged",
            "VimResized",
            "WinScrolled",
        },
        clear = {
            "BufWinLeave",
            "TabLeave",
            "TermLeave",
            "WinLeave",
        },
    },
    handlers = {
        diagnostic = true,
        search = false, -- Requires hlslens to be loaded, will run require("scrollbar.handlers.search").setup() for you
    },
})

Colors/Highlights

Color takes precedence over highlight i.e. if color is defined, that will be used to define the highlight instead of highlight.

Mark type highlights are in the format of Scrollbar<MarkType> and Scrollbar<MarkType>Handle. If you wish to define these yourself, add set_highlights = false to the setup.

  • ScrollbarHandle
  • ScrollbarSearchHandle
  • ScrollbarSearch
  • ScrollbarErrorHandle
  • ScrollbarError
  • ScrollbarWarnHandle
  • ScrollbarWarn
  • ScrollbarInfoHandle
  • ScrollbarInfo
  • ScrollbarHintHandle
  • ScrollbarHint
  • ScrollbarMiscHandle
  • ScrollbarMisc

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

Custom Handlers

One can define custom handlers consisting of a name and a lua function that returns a list of marks as follows:

require("scrollbar.handlers").register(name, handler_function)

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.

Key Description
line The line number. Required.
text Marker text. Defaults to global settings depending on type.
type The marker type. Default is Misc.
level Marker level. Default is 1.

E.g. the following marks the first three lines in every buffer.

require("scrollbar.handlers").register("my_marks", function(bufnr)
    return {
        { line = 0 },
        { line = 1, text = "x", type = "Warn" },
        { line = 2, type = "Error" }
    }
end)

Acknowledgements

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].