Show first found LSP in lualine
This commit is contained in:
parent
7d974f5115
commit
cf129ad7f6
1 changed files with 6 additions and 2 deletions
|
|
@ -4,9 +4,13 @@ local lualine = require('lualine');
|
|||
|
||||
local function active_lsps()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
local client_count = #vim.lsp.get_clients({ bufnr = buffer })
|
||||
local attached_clients = vim.lsp.get_clients({ bufnr = buffer })
|
||||
|
||||
return ('LSP: %d'):format(client_count)
|
||||
if #attached_clients == 0 then return 'LSP: 0' end
|
||||
|
||||
local preview_client = attached_clients[1]
|
||||
|
||||
return ('LSP: %s (%d)'):format(preview_client.name, #attached_clients)
|
||||
end
|
||||
|
||||
lualine.setup {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue