make branch/bufferline default statusline rather than overrides

This commit is contained in:
Bailey Ling 2013-08-06 00:35:07 -04:00
parent 8677fa875b
commit 990e3fc949
3 changed files with 13 additions and 27 deletions

View File

@ -1,19 +1,14 @@
" MIT license. Copyright (c) 2013 Bailey Ling. " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent " vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#branch#apply() function! airline#extensions#branch#init(ext)
if exists('w:airline_left_only') if g:airline_section_b == ''
return let g:airline_section_b =
endif
let w:airline_section_b =
\ exists('*fugitive#head') && strlen(fugitive#head()) > 0 \ exists('*fugitive#head') && strlen(fugitive#head()) > 0
\ ? g:airline_branch_prefix.fugitive#head() \ ? g:airline_branch_prefix.fugitive#head()
\ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 \ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0
\ ? g:airline_branch_prefix.lawrencium#statusline() \ ? g:airline_branch_prefix.lawrencium#statusline()
\ : '' \ : ''
endfunction endif
function! airline#extensions#branch#init(ext)
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
endfunction endfunction

View File

@ -1,13 +1,6 @@
" MIT license. Copyright (c) 2013 Bailey Ling. " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent " vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#bufferline#apply()
if exists('w:airline_left_only')
return
endif
let w:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
endfunction
function! airline#extensions#bufferline#init(ext) function! airline#extensions#bufferline#init(ext)
highlight AlBl_active gui=bold cterm=bold term=bold highlight AlBl_active gui=bold cterm=bold term=bold
highlight link AlBl_inactive Al6 highlight link AlBl_inactive Al6
@ -17,5 +10,7 @@ function! airline#extensions#bufferline#init(ext)
let g:bufferline_active_buffer_right = '' let g:bufferline_active_buffer_right = ''
let g:bufferline_separator = ' ' let g:bufferline_separator = ' '
call a:ext.add_statusline_funcref(function('airline#extensions#bufferline#apply')) if g:airline_section_c == '%f%m'
let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string()
endif
endfunction endfunction

View File

@ -1,12 +1,8 @@
" MIT license. Copyright (c) 2013 Bailey Ling. " MIT license. Copyright (c) 2013 Bailey Ling.
" vim: ts=2 sts=2 sw=2 fdm=indent " vim: ts=2 sts=2 sw=2 fdm=indent
function! airline#extensions#syntastic#apply()
let w:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}'
endfunction
function! airline#extensions#syntastic#init(ext) function! airline#extensions#syntastic#init(ext)
if g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') if g:airline_section_gutter == ''
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply')) let g:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}'
endif endif
endfunction endfunction