mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:58:29 +08:00
allow disabling airline per-buffer
This commit is contained in:
parent
bc0e2a3438
commit
9779a7a340
|
@ -66,6 +66,17 @@ function! airline#util#prepend(text, minwidth)
|
|||
return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
|
||||
endfunction
|
||||
|
||||
if v:version >= 704
|
||||
function! airline#util#getbufvar(bufnr, key, def)
|
||||
return getbufvar(a:bufnr, a:key, a:def)
|
||||
endfunction
|
||||
else
|
||||
function! airline#util#getbufvar(bufnr, key, def)
|
||||
let bufvals = getbufvar(a:bufnr, '')
|
||||
return get(bufvals, a:key, a:def)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
if v:version >= 704
|
||||
function! airline#util#getwinvar(winnr, key, def)
|
||||
return getwinvar(a:winnr, a:key, a:def)
|
||||
|
@ -172,9 +183,10 @@ endfunction
|
|||
|
||||
function! airline#util#stl_disabled(winnr)
|
||||
" setting the statusline is disabled,
|
||||
" either globally or per window
|
||||
" either globally, per window, or per buffer
|
||||
" w:airline_disabled is deprecated!
|
||||
return get(g:, 'airline_disable_statusline', 0) ||
|
||||
\ airline#util#getwinvar(a:winnr, 'airline_disable_statusline', 0) ||
|
||||
\ airline#util#getwinvar(a:winnr, 'airline_disabled', 0)
|
||||
\ airline#util#getwinvar(a:winnr, 'airline_disabled', 0) ||
|
||||
\ airline#util#getbufvar(winbufnr(a:winnr), 'airline_disable_statusline', 0)
|
||||
endfunction
|
||||
|
|
|
@ -234,10 +234,15 @@ values):
|
|||
<
|
||||
Old deprecated name: `w:airline_disabled`
|
||||
|
||||
See also the following option, for disabling setting the statusline globally
|
||||
See also the following options, for disabling setting the statusline
|
||||
globally or per-buffer
|
||||
* Disable setting the statusline option: >
|
||||
" disable globally
|
||||
let g:airline_disable_statusline = 1
|
||||
|
||||
" disable per-buffer
|
||||
let b:airline_disable_statusline = 1
|
||||
|
||||
< This setting disables setting the 'statusline' option. This allows to use
|
||||
e.g. the tabline extension (|airline-tabline|) but keep the 'statusline'
|
||||
option totally configurable by a custom configuration.
|
||||
|
|
Loading…
Reference in New Issue
Block a user