update example to be less dependent on internals.
This commit is contained in:
parent
68331a5e4f
commit
96e92232f6
@ -13,8 +13,7 @@ Lean & mean statusline for vim that's light as air.
|
|||||||
* Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
* Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki.
|
||||||
* Supports 7.2 as the minimum Vim version.
|
* Supports 7.2 as the minimum Vim version.
|
||||||
* Stable release cycle; bleeding edge changes happen on the `dev` branch, and after they have gone through a [full regression test][33] will eventually be merged in the stable master branch. Releases typically occur every 2 weeks.
|
* Stable release cycle; bleeding edge changes happen on the `dev` branch, and after they have gone through a [full regression test][33] will eventually be merged in the stable master branch. Releases typically occur every 2 weeks.
|
||||||
|
* Unit tests: [![Build Status](https://travis-ci.org/bling/vim-airline.png)](https://travis-ci.org/bling/vim-airline)
|
||||||
[![Build Status](https://travis-ci.org/bling/vim-airline.png)](https://travis-ci.org/bling/vim-airline)
|
|
||||||
|
|
||||||
## Straightforward customization
|
## Straightforward customization
|
||||||
|
|
||||||
|
@ -25,10 +25,14 @@ endfunction
|
|||||||
function! airline#extensions#example#apply(...)
|
function! airline#extensions#example#apply(...)
|
||||||
" First we check for the filetype.
|
" First we check for the filetype.
|
||||||
if &filetype == "nyancat"
|
if &filetype == "nyancat"
|
||||||
" Let's use a helper function. It will take care of ensuring that the
|
|
||||||
" window-local override exists (and create one based on the global
|
" Let's say we want to append to section_c, first we check if there's
|
||||||
" airline_section if not), and prepend to it.
|
" already a window-local override, and if not, create it off of the global
|
||||||
call airline#extensions#prepend_to_section('x', airline#parts#get('cats').raw)
|
" section_c.
|
||||||
|
let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c)
|
||||||
|
|
||||||
|
" Then we just append this extenion to it, optionally using separators.
|
||||||
|
let w:airline_section_c .= ' '.g:airline_left_alt_sep.' %{airline#extensions#example#get_cats()}'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user