2024-06-08 13:16:34 +03:00
|
|
|
local function has_lsp()
|
|
|
|
local buf = vim.api.nvim_get_current_buf()
|
|
|
|
local clients = vim.lsp.get_clients({ bufnr = buf })
|
|
|
|
|
|
|
|
return #clients > 0
|
|
|
|
end
|
|
|
|
|
|
|
|
local function language_servers()
|
|
|
|
local buf = vim.api.nvim_get_current_buf()
|
|
|
|
local clients = vim.lsp.get_clients({ bufnr = buf })
|
|
|
|
|
|
|
|
-- Shouldn't happen as we have the above has_lsp func but just in case
|
|
|
|
if #clients == 0 then
|
|
|
|
return "none"
|
|
|
|
end
|
|
|
|
|
|
|
|
local names = ""
|
|
|
|
|
|
|
|
for _, client in ipairs(clients) do
|
|
|
|
names = names .. client.name .. " "
|
|
|
|
end
|
|
|
|
|
|
|
|
return names
|
|
|
|
end
|
|
|
|
|
2024-05-24 16:07:28 +03:00
|
|
|
return {
|
|
|
|
{
|
|
|
|
"stevearc/dressing.nvim",
|
|
|
|
opts = {},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"rcarriga/nvim-notify",
|
|
|
|
opts = {},
|
|
|
|
},
|
2024-06-08 13:16:34 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
"nvim-lualine/lualine.nvim",
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
|
|
opts = {
|
|
|
|
options = {
|
2024-08-03 23:38:33 +03:00
|
|
|
disabled_filetypes = { "neo-tree", "minimap" },
|
2024-06-08 13:16:34 +03:00
|
|
|
globalstatus = true,
|
|
|
|
},
|
|
|
|
sections = {
|
|
|
|
lualine_y = {
|
|
|
|
"progress",
|
|
|
|
{
|
|
|
|
language_servers,
|
|
|
|
cond = has_lsp,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-05-24 16:07:28 +03:00
|
|
|
}
|