nvim-scrollview
nvim-scrollview copied to clipboard
A Neovim plugin that displays interactive vertical scrollbars and signs.
nvim-scrollview
nvim-scrollview is a Neovim plugin that displays interactive vertical
scrollbars. The plugin is customizable (see :help scrollview-configuration).
Demo
Features
- Handling for folds
- Scrollbars can be dragged with the mouse
- Partially transparent scrollbars so that text is not covered
Requirements
nvim>=0.5- Scrollbar mouse dragging requires mouse support (see
:help 'mouse') andnvim>=0.6
Installation
A package manager can be used to install nvim-scrollview.
Examples
- Vim8 packages:
git clone https://github.com/dstein64/nvim-scrollview ~/.local/share/nvim/site/pack/plugins/start/nvim-scrollview
- Vundle:
- Add
Plugin 'dstein64/nvim-scrollview'to~/.config/nvim/init.vim :PluginInstallor$ nvim +PluginInstall +qall
- Add
- Pathogen:
git clone --depth=1 https://github.com/dstein64/nvim-scrollview ~/.local/share/nvim/site/bundle/nvim-scrollview
- vim-plug:
- Add
Plug 'dstein64/nvim-scrollview', { 'branch': 'main' }to~/.config/nvim/init.vim :PlugInstallor$ nvim +PlugInstall +qall
- Add
- dein.vim:
- Add
call dein#add('dstein64/nvim-scrollview')to~/.config/nvim/init.vim :call dein#install()
- Add
- NeoBundle:
- Add
NeoBundle 'dstein64/nvim-scrollview'to~/.config/nvim/init.vim - Re-open Neovim or execute
:source ~/.config/nvim/init.vim
- Add
- packer.nvim:
- Add
use 'dstein64/nvim-scrollview'to the packer startup function :PackerInstall
- Add
Usage
nvim-scrollviewworks automatically, displaying interactive scrollbars.- The
:ScrollViewDisablecommand disables scrollbars. - The
:ScrollViewEnablecommand enables scrollbars. This is only necessary if scrollbars have previously been disabled. - The
:ScrollViewRefreshcommand refreshes the scrollbars. This is relevant when the scrollbars are out-of-sync, which can occur as a result of some window arrangement actions. - The scrollbars can be dragged. This requires a corresponding mapping, which
is automatically configured when
scrollview_auto_mouseis set (see:help scrollview-mouse-customization).
Configuration
There are various settings that can be configured. Please see the documentation for details.
Settings
- Whether scrollbars are enabled or disabled on startup
scrollview_on_startup
- File types for which scrollbars should not be displayed
scrollview_excluded_filetypes
- Scrollbar color and transparency level
ScrollViewhighlight groupscrollview_winblend
- Whether scrollbars should be displayed in all windows, or just the current
window
scrollview_current_only
- What the scrollbar position and size correspond to (i.e., how folds are
accounted for)
scrollview_mode
- Scrollbar anchor column and offset
scrollview_basescrollview_column
- Whether a mapping is automatically created for mouse support
scrollview_auto_mouse
- Whether select workarounds are automatically applied for known issues
scrollview_auto_workarounds
- Refresh time limit that triggers setting
scrollview_modetosimplescrollview_refresh_time
- A character to display on scrollbars
scrollview_character
- Whether each scrollbar becomes hidden when intersecting a floating window
scrollview_hide_on_intersect
VimScript Example
let g:scrollview_excluded_filetypes = ['nerdtree']
let g:scrollview_current_only = 1
let g:scrollview_winblend = 75
" Position the scrollbar at the 80th character of the buffer
let g:scrollview_base = 'buffer'
let g:scrollview_column = 80
Lua Setup Example
require('scrollview').setup({
excluded_filetypes = {'nerdtree'},
current_only = true,
winblend = 75,
base = 'buffer',
column = 80
})
Documentation
Documentation can be accessed with:
:help nvim-scrollview
The underlying markup is in scrollview.txt.
License
The source code has an MIT License.
See LICENSE.