Commit 6cbf1dbd authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

vim: add lightline as statusline

parent 318eb2b7
......@@ -22,3 +22,6 @@
[submodule "vim/pack/adrien/start/coc.nvim"]
path = vim/pack/adrien/start/coc.nvim
url = https://github.com/neoclide/coc.nvim.git
[submodule "vim/pack/adrien/lightline"]
path = vim/pack/adrien/start/lightline
url = https://github.com/itchyny/lightline.vim
Subproject commit 8e013f32f524157bf14ccaa87d97be3d3a7201e2
......@@ -83,6 +83,25 @@ let g:ctrlp_custom_ignore = {
let g:vimspector_enable_mappings = 'HUMAN'
let g:vimspector_base_dir=expand( '$HOME/.config/vimspector' )
" Lightline
set laststatus=2
set noshowmode
function! CocCurrentFunction()
return get(b:, 'coc_current_function', '')
endfunction
let g:lightline = {
\ 'colorscheme': 'darcula',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'currentfunction', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status',
\ 'currentfunction': 'CocCurrentFunction'
\ },
\ }
"
" Coc
"
......@@ -95,7 +114,7 @@ set nobackup
set nowritebackup
" Coc: Give more space for displaying messages.
set cmdheight=2
"set cmdheight=2
" Coc: Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
......@@ -178,9 +197,6 @@ command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
......@@ -189,3 +205,4 @@ nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
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