mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-02-17 01:52:46 +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
|
return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
|
||||||
endfunction
|
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
|
if v:version >= 704
|
||||||
function! airline#util#getwinvar(winnr, key, def)
|
function! airline#util#getwinvar(winnr, key, def)
|
||||||
return getwinvar(a:winnr, a:key, a:def)
|
return getwinvar(a:winnr, a:key, a:def)
|
||||||
|
@ -172,9 +183,10 @@ endfunction
|
||||||
|
|
||||||
function! airline#util#stl_disabled(winnr)
|
function! airline#util#stl_disabled(winnr)
|
||||||
" setting the statusline is disabled,
|
" setting the statusline is disabled,
|
||||||
" either globally or per window
|
" either globally, per window, or per buffer
|
||||||
" w:airline_disabled is deprecated!
|
" w:airline_disabled is deprecated!
|
||||||
return get(g:, 'airline_disable_statusline', 0) ||
|
return get(g:, 'airline_disable_statusline', 0) ||
|
||||||
\ airline#util#getwinvar(a:winnr, '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
|
endfunction
|
||||||
|
|
|
@ -234,10 +234,15 @@ values):
|
||||||
<
|
<
|
||||||
Old deprecated name: `w:airline_disabled`
|
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 setting the statusline option: >
|
||||||
|
" disable globally
|
||||||
let g:airline_disable_statusline = 1
|
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
|
< This setting disables setting the 'statusline' option. This allows to use
|
||||||
e.g. the tabline extension (|airline-tabline|) but keep the 'statusline'
|
e.g. the tabline extension (|airline-tabline|) but keep the 'statusline'
|
||||||
option totally configurable by a custom configuration.
|
option totally configurable by a custom configuration.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user