https://github.com/ojroques/vim-scrollstatus
A Vim plugin to display a scrollbar in the statusline
https://github.com/ojroques/vim-scrollstatus
scrollbar vim-plugin vim-scrollbar
Last synced: 3 months ago
JSON representation
A Vim plugin to display a scrollbar in the statusline
- Host: GitHub
- URL: https://github.com/ojroques/vim-scrollstatus
- Owner: ojroques
- License: bsd-2-clause
- Created: 2020-03-14T11:07:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-27T09:46:14.000Z (over 1 year ago)
- Last Synced: 2025-02-27T17:26:51.667Z (3 months ago)
- Topics: scrollbar, vim-plugin, vim-scrollbar
- Language: Vim Script
- Homepage:
- Size: 515 KB
- Stars: 78
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-scrollstatus
A scrollbar for Vim statusline. For Neovim, check out
[nvim-scrollbar](https://github.com/ojroques/nvim-scrollbar).
## Installation
With [vim-plug](https://github.com/junegunn/vim-plug):
```vim
call plug#begin()
Plug 'ojroques/vim-scrollstatus'
call plug#end()
```## Usage
With [vim-airline](https://github.com/vim-airline/vim-airline):
```vim
let g:airline_section_x = '%{ScrollStatus()}'
```With [lightline.vim](https://github.com/itchyny/lightline.vim):
```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:
```vim
let g:scrollstatus_size = 12
```By default the symbols are set to `░` for the track and `█` for the bar. To change them:
```vim
let g:scrollstatus_symbol_track = '-'
let g:scrollstatus_symbol_bar = '|'
```## Example
To reproduce the statusline from the screenshot:
```vim
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}',
\ ])
```