Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Adrien Dorsaz
config
Commits
d5da3ac5
Commit
d5da3ac5
authored
Jan 30, 2021
by
Adrien Dorsaz
Browse files
vim: merge bufnum, filename and modified identifier in one component of lightline
parent
6cbf1dbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
vim/vimrc
View file @
d5da3ac5
...
...
@@ -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'
\ },
\ }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment