mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-11 07:55:31 +00:00
feat: display LSP source on statusline
This commit is contained in:
parent
acf14daea2
commit
0c01fbc121
3 changed files with 25 additions and 3 deletions
|
|
@ -183,6 +183,25 @@ in {
|
|||
description = "active config for: | A | B | C (X) | Y | Z |";
|
||||
default = ''
|
||||
{
|
||||
{
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = 'No Active Lsp'
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = ' ',
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
|
||||
|
|
@ -227,7 +246,6 @@ in {
|
|||
separator = {
|
||||
left = '',
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
"location",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue