mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
Adding a mention of add_inactive_statusline_func (as suggested in this issue: https://github.com/vim-airline/vim-airline/issues/987)
parent
fe2672c58c
commit
7aa233f59d
@ -9,3 +9,20 @@ Prepend a '$' when obsession is enabled ([origin](https://github.com/vim-airline
|
|||||||
```viml
|
```viml
|
||||||
let g:airline_section_z = airline#section#create(['%{ObsessionStatus(''$'', '''')}', 'windowswap', '%3p%% ', 'linenr', ':%3v '])
|
let g:airline_section_z = airline#section#create(['%{ObsessionStatus(''$'', '''')}', 'windowswap', '%3p%% ', 'linenr', ':%3v '])
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Overriding the inactive statusline
|
||||||
|
`add_inactive_statusline_func` (counterpart to `add_statusline_func`) can be used to add to (or completely override) the inactive statusline:
|
||||||
|
```viml
|
||||||
|
function! Render_Only_File(...)
|
||||||
|
let builder = a:1
|
||||||
|
let context = a:2
|
||||||
|
|
||||||
|
call builder.add_section('file', '!! %F')
|
||||||
|
|
||||||
|
return 0 " the default: draw the rest of the statusline
|
||||||
|
return -1 " do not modify the statusline
|
||||||
|
return 1 " modify the statusline with the current contents of the builder
|
||||||
|
endfunction
|
||||||
|
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` section [airline-funcrefs](https://github.com/vim-airline/vim-airline/blob/master/doc/airline.txt#L784).
|
Loading…
x
Reference in New Issue
Block a user