diff --git a/Configuration-Examples-and-Snippets.md b/Configuration-Examples-and-Snippets.md index a3c1938..188850b 100644 --- a/Configuration-Examples-and-Snippets.md +++ b/Configuration-Examples-and-Snippets.md @@ -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). \ No newline at end of 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). + +## 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']) +``` \ No newline at end of file