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 settings are required. A scrollbar will automatically appear on the right edge of the current window.
Tip
As you move the cursor and scroll, the scrollbar's position will be updated immediately.
On the other hand, if you scroll without moving the cursor (you can do this
with <C-e>
or <C-y>
etc.), the scrollbar's position will be updated after
the time specified with the updatetime
option.
The default value of updatetime
is 4000
, i.e. 4 seconds. If you want to
update the scrollbar's position as soon as possible, 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
You can also customize the offset of the scrollbar from the right border of the
window with g:sclow_bar_right_offset
(default: 0
). Setting this to -1
helps to prevent the scrollbar from hiding the rightmost characters of the
window.
Blocking
To disable scrollbar in a specific buffer, you can use:
g:sclow_block_filetypes
(default:[]
)g:sclow_block_buftypes
(default:[]
)
Example:
let g:sclow_block_filetypes = ['netrw', 'nerdtree']
let g:sclow_block_buftypes = ['terminal', 'prompt']
Hiding
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 hide this, use the following:
let g:sclow_hide_full_length = 1
See help file for more information.
License
MIT License.