Vim Scrollstatus Save

A Vim plugin to display a scrollbar in the statusline

Project README

vim-scrollstatus

A scrollbar for Vim statusline. For Neovim, check out nvim-scrollbar.

demo

Installation

With vim-plug:

call plug#begin()
Plug 'ojroques/vim-scrollstatus'
call plug#end()

Usage

With vim-airline:

let g:airline_section_x = '%{ScrollStatus()}'

With lightline.vim:

let g:lightline = {
  \ 'active': {
  \   'right': [['lineinfo'], ['percent'], ['fileformat', 'fileencoding', 'filetype', 'charvaluehex']]
  \ },
  \ 'component_function': {'percent': 'ScrollStatus'},
  \ }

Configuration

By default the scrollbar is 20 characters long. You can set another value with:

let g:scrollstatus_size = 12

By default the symbols are set to for the track and for the bar. To change them:

let g:scrollstatus_symbol_track = '-'
let g:scrollstatus_symbol_bar = '|'

Example

To reproduce the statusline from the screenshot:

call plug#begin()
Plug 'vim-airline/vim-airline'
Plug 'ojroques/vim-scrollstatus'
call plug#end()

let g:airline_section_x = '%{ScrollStatus()} '
let g:airline_section_y = airline#section#create_right(['filetype'])
let g:airline_section_z = airline#section#create([
            \ '%#__accent_bold#%3l%#__restore__#/%L', ' ',
            \ '%#__accent_bold#%3v%#__restore__#/%3{virtcol("$") - 1}',
            \ ])
Open Source Agenda is not affiliated with "Vim Scrollstatus" Project. README Source: ojroques/vim-scrollstatus
Stars
78
Open Issues
0
Last Commit
5 months ago
License

Open Source Agenda Badge

Open Source Agenda Rating