From ad3eee7e72549fbf081218e7ca16c2e0bb2c0691 Mon Sep 17 00:00:00 2001 From: oldratlee Date: Wed, 23 Mar 2016 14:17:17 +0800 Subject: [PATCH] add total line next to line number An alternative approach to PR1103 --- autoload/airline/init.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index dc7270b5..c239ffc2 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -63,6 +63,7 @@ function! airline#init#bootstrap() \ 'readonly': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO', \ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!', \ 'linenr': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':', + \ 'maxlinenr': get(g:, 'airline_powerline_fonts', 0) ? "\u2630" : '', \ 'branch': get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : '', \ 'notexists': "\u2204", \ 'modified': '+', @@ -88,6 +89,9 @@ function! airline#init#bootstrap() call airline#parts#define('linenr', { \ 'raw': '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#', \ 'accent': 'bold'}) + call airline#parts#define('maxlinenr', { + \ 'raw': '%#__accent_bold#/%L%{g:airline_symbols.maxlinenr}%#__restore__#', + \ 'accent': 'bold'}) call airline#parts#define_function('ffenc', 'airline#parts#ffenc') call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', \ 'eclim', 'whitespace','windowswap', 'ycm_error_count', 'ycm_warning_count']) @@ -127,7 +131,7 @@ function! airline#init#sections() let g:airline_section_y = airline#section#create_right(['ffenc']) endif if !exists('g:airline_section_z') - let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3v ']) + let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v']) endif if !exists('g:airline_section_error') let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic', 'eclim'])