vim-airline-themes/autoload/airline/extensions/branch.vim

24 lines
561 B
VimL
Raw Normal View History

2013-08-06 11:07:01 +08:00
" MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent
2013-08-19 01:22:35 +08:00
function! airline#extensions#branch#get_head()
let head = ''
if exists('*fugitive#head')
let head = fugitive#head()
endif
if empty(head)
if exists('*lawrencium#statusline')
let head = lawrencium#statusline()
endif
endif
return empty(head) ? g:airline_branch_empty_message : g:airline_branch_prefix.head
2013-08-06 12:42:59 +08:00
endfunction
2013-08-06 11:07:01 +08:00
function! airline#extensions#branch#init(ext)
2013-08-19 01:22:35 +08:00
let g:airline_section_b .= '%{airline#extensions#branch#get_head()}'
2013-08-06 11:07:01 +08:00
endfunction