diff options
| author | Robert Günzler <r@gnzler.io> | 2020-06-13 14:31:05 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-06-13 14:31:05 +0200 |
| commit | 9b5a1d1dc2ad9636b5f31a0ea092595d582e13a9 (patch) | |
| tree | 3ed065591f79a3c103a314629cebafec39f0cf09 | |
| parent | 4e1976db0be768d1de0bb8786a5a170ca57ca2a8 (diff) | |
vim: add buffer and tab info to statusline
Diffstat (limited to '')
| -rw-r--r-- | .vim/plugin/line.vim | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/.vim/plugin/line.vim b/.vim/plugin/line.vim index 00d5ddf..2707175 100644 --- a/.vim/plugin/line.vim +++ b/.vim/plugin/line.vim @@ -25,8 +25,7 @@ let g:lightline.active = { \ ], \ 'right': [ \ ['filetype', 'fileencoding', 'fileformat'], -\ ['lineinfo', 'percent'], -\ ['tabstatus'], +\ ['indent', 'bufnum', 'lineinfo', 'percent'], \ ], \ } @@ -57,12 +56,14 @@ let g:lightline.component = { let g:lightline.component_function = { \ 'filename': 'LightLineFilename', +\ 'bufnum': 'LightLineBufnum', \ 'fileformat': 'LightLineFileformat', \ 'fileencoding': 'LightLineFileencoding', \ 'mode': 'LightLineMode', \ 'vista': 'LightLineVista', \ 'o': 'LightLineO', \ 'porcelain': 'LightLinePorcelain', +\ 'indent': 'LightLineIndent', \ } " \ 'separator': { 'left': "\ue0b8", 'right': "\ue0be" }, @@ -91,11 +92,18 @@ endfunction " Filename {{{ function! LightLineFilename() return ('' !=? LightLineReadonly() ? LightLineReadonly() . ' ' : '') . - \ (&filetype ==# 'vimfiler' ? vimfiler#get_status_string() : - \ &filetype ==# 'unite' ? unite#get_status_string() : - \ &filetype ==# 'vimshell' ? vimshell#get_status_string() : - \ '' !=? expand('%:t') ? expand('%:t') : '[No Name]') . - \ ('' !=? LightLineModified() ? ' ' . LightLineModified() : '') + \ (&filetype ==# 'vimfiler' ? vimfiler#get_status_string() : + \ &filetype ==# 'unite' ? unite#get_status_string() : + \ &filetype ==# 'vimshell' ? vimshell#get_status_string() : + \ '' !=? expand('%:t') ? expand('%:t') : '[No Name]') . + \ ('' !=? LightLineModified() ? ' ' . LightLineModified() : '') +endfunction +" }}} + +" Bufnum {{{ +function! LightLineBufnum() + let l:nbufs = len(getbufinfo({'buflisted':1})) + return '% '. bufnr('%') . '('.l:nbufs.')' . (tabpagenr() != 1 ? ':'. tabpagenr() : '') endfunction " }}} @@ -129,13 +137,13 @@ function! LightLineMode() endfunction " }}} -" Tabchar {{{ -function! LightLineTabchar() - return '[' - \ . &tabstop - \ . (&expandtab == 1 ? '->' : '<>') - \ . &shiftwidth - \ . ']' +" Indent {{{ +function! LightLineIndent() + return '' . + \ (&expandtab == 1 ? '␣' : '→') . ' ' . + \ 'ts=' . &tabstop . + \ ' ' . + \ 'sw=' . &shiftwidth endfunction " }}} |