josa42 / vim-lightline-sensible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lightline-sensible

Installation

Install using a plugin manager of your choice, for example vim-plug:

Plug 'josa42/vim-lightline-sensible'

Features

  • All components are hidden in NERDTree or other plugin buffers.
    If I missed something, feel free to open an issue.

Components

  • mode
  • readonly
  • filename
  • modified
  • lineinfo
  • percent
  • fileformat
  • fileencoding
  • filetype
  • gitbranch Show current git branch
    Requires vim-fugitive or vim-gitbranch

Integration

let g:lightline = {
  \   'active': {
  \     'left': [
  \       [ 'mode', 'paste' ],
  \       [ 'gitbranch'],
  \       [ 'readonly', 'filename', 'modified' ],
  \     ],
  \     'right': [
  \       [ 'lineinfo' ],
  \       [ 'percent' ],
  \       [ 'fileformat', 'fileencoding', 'filetype' ],
  \     ]
  \   },
  \ }

" register compoments:
call lightline#sensible#register()

Helper

  • lightline#sensible#isHidden() Can be used in custom components:

    function! MyComponent()
      if exists('*lightline#sensible#isHidden') && lightline#sensible#isHidden()
        return ''
      endif
      return 'Hello'
    endfunction
    
    let g:lightline['component_function']['my_component'] = 'MyComponent'

License

MIT © Josa Gesell

About

License:MIT License


Languages

Language:Vim Script 100.0%