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
6cbf1dbd
Commit
6cbf1dbd
authored
Jan 30, 2021
by
Adrien Dorsaz
Browse files
vim: add lightline as statusline
parent
318eb2b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitmodules
View file @
6cbf1dbd
...
...
@@ -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
lightline
@
8e013f32
Subproject commit 8e013f32f524157bf14ccaa87d97be3d3a7201e2
vim/vimrc
View file @
6cbf1dbd
...
...
@@ -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>
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