mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
Updated Configuration Examples and Snippets (markdown)
parent
6755cb66c6
commit
a2f7d5bfb9
@ -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).
|
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.
|
||||||
|

|
||||||
|
|
||||||
## Human readable Line number (with thousands separators)
|
## 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))
|
This adds comma as thousands separator to the line number (issue [#1382](https://github.com/vim-airline/vim-airline/issues/1382))
|
||||||
```viml
|
```viml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user