Commit d5da3ac5 authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

vim: merge bufnum, filename and modified identifier in one component of lightline

parent 6cbf1dbd
......@@ -86,19 +86,27 @@ let g:vimspector_base_dir=expand( '$HOME/.config/vimspector' )
" Lightline
set laststatus=2
set noshowmode
function! CocCurrentFunction()
return get(b:, 'coc_current_function', '')
endfunction
function! LightlineFileName()
let filename = expand('%:t') !=# '' ? expand('%:t') : '[New]'
let modified = &modified ? '*': ''
return bufnr() . '>' . filename . modified
endfunction
let g:lightline = {
\ 'colorscheme': 'darcula',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'currentfunction', 'readonly', 'filename', 'modified' ] ]
\ [ 'readonly', 'filename', 'cocstatus', 'currentfunction' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status',
\ 'currentfunction': 'CocCurrentFunction'
\ 'currentfunction': 'CocCurrentFunction',
\ 'filename': 'LightlineFileName'
\ },
\ }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment