a scrollbar for vim in the terminal
- unicode characters for high-resolution
- mouse click support
- customizable colors and glyphs
- vundle:
Plugin 'sslivkoff/vim-scroll-barnacle'
- vim-plug:
Plug 'sslivkoff/vim-scroll-barnacle'
- change scrollbar state with
:ScrollbarToggle
:ScrollbarOn
:ScrollbarOff
- can bind to keys e.g.
nnoremap <silent> <F1> :ScrollbarToggle<cr>
- can put these in your vimrc, e.g.
let g:sb_default_behavior = "always"
g:sb_default_behavior
whether scrollbar is on by default (default ="overflow"
)"always"
: scrollbar always on"overflow"
: scrollbar on when buffer does not fit in window"never"
: scrollbar off by default
g:sb_bar_style
style to use for scrollbar (default ="solid"
)"solid"
solid scrollbar using▁▂▃▄▅▆▇█
"left dot"
dot scrollbar using⠁⠂⠄⡀⠃⠆⡄⠇⡆⡇
"right dot"
dot scrollbar using⠈⠐⠠⢀⠘⠰⢠⠸⢰⢸
"double dot"
dot scrollbar using⠉⠒⠤⣀⠛⠶⣤⠿⣶⣿
g:sb_patch_mouse
whether to patch mouse for mouse click events (default =1
)- see section below
g:sb_patch_keys
whether to patch certain keys for scroll events (default =1
)Scrollbar
highlight group- change scrollbar color using the
Scrollbar
highlight group - e.g.
highlight Scrollbar guifg=grey
highlight link Scrollbar Normal
[default]highlight link Scrollbar Comment
- change scrollbar color using the
- uses floating window, window has filetype
scrollbar
- gifine and vim-smoothie used for creating the gif in this readme
- weclome to suggestions, bug reports, and pull requests
- Neovim only for now
- some
nvim_*
functions in the neovim api were crucial for functionality and efficiency - suggestions on how to port to vim welcome
- some
- Can only mouse click, not mouse drag
- The vim mouse api is very limited
- Clicking requires patching
<LeftMouse>
input - Can disable this patching with
let g:sb_patch_mouse = 0
- Vim does not emit scroll events directly
- Most actions that affect the scrollbar can be detected indirectly using vim events (e.g.
CursorMove
andVimResize
) - However, some scroll actions are not detectable with events
- ScrollBarnacle patches these key combinations so that they can affect the scrollbar:
zz
,zt
,zb
,<C-e>
,<C-y>
,<ScrollWheelUp>
,<ScrollWheelDown>
- You can disable this patching with
let g:sb_patch_keys = 0
- Most actions that affect the scrollbar can be detected indirectly using vim events (e.g.
- Does not work with tabs