Updated Configuration Examples and Snippets (markdown)

Christian Brabandt 2017-06-26 19:05:59 +02:00
parent 6755cb66c6
commit a2f7d5bfb9
1 changed files with 16 additions and 0 deletions

@ -34,6 +34,22 @@ call airline#add_inactive_statusline_func('Render_Only_File')
```
More information on the use of the `builder` and `context` arguments can be found in `:help` sections [airline-funcrefs](https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L784) and [airline-pipeline](https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L819).
### A different example: Add the window number in front of the mode
```viml
function! WindowNumber(...)
let builder = a:1
let context = a:2
call builder.add_section('airline_b', '%{tabpagewinnr(tabpagenr())}')
return 0
endfunction
call airline#add_statusline_func('WindowNumber')
call airline#add_inactive_statusline_func('WindowNumber')
```
That will look like this (note however that the tagbar extension does not apply the inactive funcref, because
it handles setting the statusline itself.
![2017-01-07 6 07 40](https://cloud.githubusercontent.com/assets/196861/21740970/7e242c6a-d504-11e6-8683-89699c243e32.png)
## Human readable Line number (with thousands separators)
This adds comma as thousands separator to the line number (issue [#1382](https://github.com/vim-airline/vim-airline/issues/1382))
```viml