vim-sclow
Text-based scrollbar for Vim.
Installation
Requires Vim compiled with +popupwin feature (Neovim is not supported).
If you use vim-plug, add the following line to your vimrc:
Plug 'obcat/vim-sclow'
You can use any other plugin manager.
Usage
No configuration is required. Scrollbar is automaticaly shown in the current window.
When will scrollbar's position be updated?
When you scroll with cursor moves, the scrollbar's position is updated immediately. On the other hand, scrolling without cursor moves (you can do this with <C-e>
or <C-y>
), the position will be updated after the time specified with updatetime
option. The default value is 4000
, i.e. 4 seconds. If you want to update the scrollbar's position as soon as possible in the latter situation, reduce the value of this option. I suggest around 100ms:
set updatetime=100
Note that updatetime
also controls the delay before Vim writes its swap file (see :h updatetime
).
Customization
You can customize some features.
Appearance
To customize scrollbar's appearance, you can use:
g:sclow_sbar_text
(default:"\<Space>"
)SclowSbar
highlight group (default: links toPmenu
)
Examples:
let g:sclow_sbar_text = '*'
highlight link SclowSbar PmenuSel
let g:sclow_sbar_text = '👾👾'
highlight SclowSbar ctermbg=NONE guibg=NONE
Blocking
If you don't want to see the scrollbar in a specific buffer, you can use:
g:sclow_block_filetypes
(default:''
)g:sclow_block_bufnames
(default:''
)g:sclow_block_buftypes
(default:''
)
Use regular expression to specify the pattern. Empty string means non-blocking.
Example:
let g:sclow_block_filetypes = '\(netrw\|nerdtree\)'
let g:sclow_block_buftypes = '\(terminal\|prompt\)'
Misc
By default, when both the first and last line of the buffer are in the window, a full-length scrollbar will be shown.
If you want to turn this off, you can use:
let g:show_full_length_sbar = 0
See help file for more information.
License
MIT License.