formating of line numers

Christian Brabandt 2017-01-27 12:07:12 +01:00
parent a307ac9a7a
commit 6a6752994c

@ -25,4 +25,17 @@ function! Render_Only_File(...)
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` 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).
## Human readable Line number (with thousands separators)
This adds comma as thousands separator to the line number (issue #1382)
```viml
function! MyLineNumber()
return substitute(line('.'), '\d\@<=\(\(\d\{3\}\)\+\)$', ',&', 'g'). ' | '.
\ substitute(line('$'), '\d\@<=\(\(\d\{3\}\)\+\)$', ',&', 'g')
endfunction
call airline#parts#define('linenr', {'function': 'MyLineNumber', 'accents': 'bold'})
let g:airline_section_z = airline#section#create(['%3p%%: ', 'linenr', ':%3v'])
```