mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-26 23:44:30 +02:00
formating of line numers
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'])
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user