2013-08-05 23:07:01 -04:00
|
|
|
" MIT license. Copyright (c) 2013 Bailey Ling.
|
|
|
|
" vim: ts=2 sts=2 sw=2 fdm=indent
|
|
|
|
|
2013-08-18 13:22:35 -04: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 00:42:59 -04:00
|
|
|
endfunction
|
|
|
|
|
2013-08-05 23:07:01 -04:00
|
|
|
function! airline#extensions#branch#init(ext)
|
2013-08-18 13:22:35 -04:00
|
|
|
let g:airline_section_b .= '%{airline#extensions#branch#get_head()}'
|
2013-08-05 23:07:01 -04:00
|
|
|
endfunction
|
|
|
|
|