This plugin provides git hunks and git branch for lightline.
Use a plugin manager you want, like vim-plug:
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'sinetoami/lightline-hunks'Run :so % and :PlugInstall.
- Register the components:
let g:lightline.component_function = {
\ 'lightline_hunks': 'lightline#hunks#composer',
\ }- Add the component to the lightline:
let g:lightline.active = { 'left': [['lightline_hunks']] }Symbol visible to the left of the branch. Default is .
Hunk count symbols. Default is ['+', '~', '-'] to added, changed and deleted respectivelly.
let g:lightline#hunks#hunk_symbols = [ 'A:', 'M:', 'R:' ]Prevent certain filetypes from showing Git information. Default is [].
let g:lightline#hunks#exclude_filetypes = [ 'startify', 'nerdtree', 'vista_kind', 'tagbar' ]When set with 1 will shows only branch name and symbol. Default is 0.
let g:lightline#hunks#only_branch = 1