vimrc: update fugitive settings

This commit is contained in:
Rob Watson 2021-03-21 21:30:20 +01:00
parent f192da86a7
commit 36cdb07652
1 changed files with 4 additions and 9 deletions

13
vimrc
View File

@ -171,13 +171,7 @@ nmap <leader>gg :Rg<cr>
" Lightline configuration: " Lightline configuration:
packadd! lightline.vim packadd! lightline.vim
function! GitHead() set laststatus=2
let l:head = FugitiveHead()
if l:head == ''
return ''
endif
return '[' . l:head . ']'
endfunction
function! LightlineLSPErrorText() function! LightlineLSPErrorText()
let l:info = lsp#get_buffer_diagnostics_counts() let l:info = lsp#get_buffer_diagnostics_counts()
@ -197,7 +191,6 @@ function! LightlineLSPWarningText()
return info.warning . sign return info.warning . sign
endfunction endfunction
set laststatus=2
let g:lightline = { let g:lightline = {
\ 'colorscheme': 'seoul256', \ 'colorscheme': 'seoul256',
\ 'active': { \ 'active': {
@ -208,7 +201,7 @@ let g:lightline = {
\ }, \ },
\ 'component_function': { \ 'component_function': {
\ 'gobuild': 'go#statusline#Show', \ 'gobuild': 'go#statusline#Show',
\ 'gitbranch': 'GitHead', \ 'gitbranch': 'FugitiveStatusline',
\ }, \ },
\ 'component_expand': { \ 'component_expand': {
\ 'lsperror': 'LightlineLSPErrorText', \ 'lsperror': 'LightlineLSPErrorText',
@ -283,6 +276,8 @@ let g:lsp_diagnostics_float_cursor = 1
function! s:on_lsp_buffer_enabled() abort function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete setlocal omnifunc=lsp#complete
setlocal signcolumn=yes setlocal signcolumn=yes
" number may be clobbered by vim-fugitive?
setlocal number
" Jump to definitions " Jump to definitions
nmap <buffer> gd <plug>(lsp-definition) nmap <buffer> gd <plug>(lsp-definition)