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-06 12:42:59 +08:00
|
|
|
function! airline#extensions#branch#apply()
|
|
|
|
let g:airline_current_branch = exists('*fugitive#head') && strlen(fugitive#head()) > 0
|
|
|
|
\ ? g:airline_branch_prefix.fugitive#head()
|
|
|
|
\ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0
|
|
|
|
\ ? g:airline_branch_prefix.lawrencium#statusline()
|
|
|
|
\ : ''
|
|
|
|
endfunction
|
|
|
|
|
2013-08-06 11:07:01 +08:00
|
|
|
function! airline#extensions#branch#init(ext)
|
2013-08-06 12:42:59 +08:00
|
|
|
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
|
2013-08-06 11:07:01 +08:00
|
|
|
endfunction
|
|
|
|
|