nvim-scrollview
is a Neovim plugin that displays interactive vertical
scrollbars and signs. The plugin is customizable (see :help scrollview-configuration
).
(a scrollbar and signs can be seen near the right edge of the preceding image)
diagnostics
and search
enabled by default)nvim>=0.5
:help 'mouse'
) and
nvim>=0.6
nvim>=0.7
A package manager can be used to install nvim-scrollview
.
git clone https://github.com/dstein64/nvim-scrollview ~/.local/share/nvim/site/pack/plugins/start/nvim-scrollview
Plugin 'dstein64/nvim-scrollview'
to ~/.config/nvim/init.vim
:PluginInstall
or $ nvim +PluginInstall +qall
git clone --depth=1 https://github.com/dstein64/nvim-scrollview ~/.local/share/nvim/site/bundle/nvim-scrollview
Plug 'dstein64/nvim-scrollview', { 'branch': 'main' }
to ~/.config/nvim/init.vim
:PlugInstall
or $ nvim +PlugInstall +qall
call dein#add('dstein64/nvim-scrollview')
to ~/.config/nvim/init.vim
:call dein#install()
NeoBundle 'dstein64/nvim-scrollview'
to ~/.config/nvim/init.vim
:source ~/.config/nvim/init.vim
use 'dstein64/nvim-scrollview'
to the packer startup function:PackerInstall
nvim-scrollview
works automatically, displaying interactive scrollbars.:ScrollViewDisable
disables the plugin. When arguments are given,
the specified sign groups are disabled.:ScrollViewEnable
enables the plugin. This is only necessary if
nvim-scrollview has previously been disabled. When arguments are given,
the specified sign groups are enabled.:ScrollViewToggle
toggles the plugin. When arguments are given, the
specified sign groups are toggled.:ScrollViewRefresh
refreshes the scrollbars and signs. This is relevant
when the scrollbars or signs are out-of-sync, which can occur as a result of
some window arrangement actions.:ScrollViewNext
, :ScrollViewPrev
, :ScrollViewFirst
, and
ScrollViewLast
move the cursor to lines with signs. Arguments can specify
which sign groups are considered.scrollview_auto_mouse
is set (see :help scrollview-mouse-customization
).There is built-in support for various types of signs (referred to as "sign groups"), listed below. The functionality is similar to the sign column, but with the same positioning logic as the scrollbar.
conflicts
: git merge conflictscursor
: cursor positiondiagnostics
: errors, warnings, info, and hintsfolds
: closed foldsloclist
: items on the location listmarks
quickfix
: items on the quickfix listsearch
spell
: spell check items when the spell
option is enabledtextwidth
: line lengths exceeding the value of the textwidth option, when
non-zerotrail
: trailing whitespace, when the list
option is enabled and the
listchars
option includes "trail"search
and diagnostics
groups are enabled by default.
The plugin was written so that it's possible to extend the sign functionality
in a Neovim configuration file or with a plugin. See the documentation for
details. An example was created to show how support for
gitsigns.nvim could be implemented. Plugin authors can tag
their repos with scrollview-signs
for discoverability.
There are various settings that can be configured. Please see the documentation for details.
let g:scrollview_excluded_filetypes = ['nerdtree']
let g:scrollview_current_only = v:true
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
" Enable all sign groups (defaults to ['diagnostics', 'search']).
" Set to the empty list to disable all sign groups.
let g:scrollview_signs_on_startup = ['all']
" Show diagnostic signs only for errors.
let g:scrollview_diagnostics_severities =
\ [luaeval('vim.diagnostic.severity.ERROR')]
require('scrollview').setup({
excluded_filetypes = {'nerdtree'},
current_only = true,
winblend = 75,
base = 'buffer',
column = 80,
signs_on_startup = {'all'},
diagnostics_severities = {vim.diagnostic.severity.ERROR}
})
Documentation can be accessed with:
:help nvim-scrollview
The underlying markup is in scrollview.txt.
Documentation for issues, along with some workarounds, can be accessed with:
:help scrollview-issues
Some of the known issues are regarding scrollbar synchronization, error messages, session
restoration, and scrollbar floating windows being included in the window count returned by
winnr('$')
.
The source code has an MIT License.
See LICENSE.