mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-26 10:13:42 +08:00
make branch/bufferline default statusline rather than overrides
This commit is contained in:
parent
8677fa875b
commit
990e3fc949
|
@ -1,19 +1,14 @@
|
|||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: ts=2 sts=2 sw=2 fdm=indent
|
||||
|
||||
function! airline#extensions#branch#apply()
|
||||
if exists('w:airline_left_only')
|
||||
return
|
||||
endif
|
||||
let w:airline_section_b =
|
||||
\ 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
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#branch#apply'))
|
||||
if g:airline_section_b == ''
|
||||
let g:airline_section_b =
|
||||
\ 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()
|
||||
\ : ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" 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)
|
||||
highlight AlBl_active gui=bold cterm=bold term=bold
|
||||
highlight link AlBl_inactive Al6
|
||||
|
@ -17,5 +10,7 @@ function! airline#extensions#bufferline#init(ext)
|
|||
let g:bufferline_active_buffer_right = ''
|
||||
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
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
" MIT license. Copyright (c) 2013 Bailey Ling.
|
||||
" 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)
|
||||
if g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag')
|
||||
call a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply'))
|
||||
if g:airline_section_gutter == ''
|
||||
let g:airline_section_gutter = '%#warningmsg#%{SyntasticStatuslineFlag()}'
|
||||
endif
|
||||
endfunction
|
||||
|
|
Loading…
Reference in New Issue
Block a user