feat(lightline-vim): add lsp status

This commit is contained in:
Felix Schröter 2020-08-27 14:20:58 +02:00
parent a6c2877b0d
commit 57b8cc4723
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58

View file

@ -40,15 +40,19 @@ let mapleader=" "
let maplocalleader=","
let g:camelcasemotion_key = '<leader>'
function! LspStatus() abort
let has_client = luaeval('not vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
return has_client ? 'LSP' : ''
endfunction
let g:lightline = {
\ 'colorscheme': 'powerline',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'cocstatus', 'currentfunction', 'readonly', 'filename', 'modified' ] ]
\ [ 'lspstatus', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'coc#status',
\ 'currentfunction': 'CocCurrentFunction'
\ 'lspstatus': 'LspStatus'
\ },
\ }