GithubHelp home page GithubHelp logo

yinghaoyu / vim-scrollstatus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ojroques/vim-scrollstatus

0.0 0.0 0.0 527 KB

A Vim plugin to display a scrollbar in the statusline

License: BSD 2-Clause "Simplified" License

Vim Script 100.00%

vim-scrollstatus's Introduction

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}',
            \ ])

vim-scrollstatus's People

Contributors

ojroques avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.