feat(statusline): show active lsp clients
This commit is contained in:
parent
734d1d2ef0
commit
ecf36ee938
4 changed files with 39 additions and 2 deletions
|
@ -35,10 +35,8 @@ local args = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
update_cwd = true,
|
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = true,
|
enable = true,
|
||||||
update_cwd = true,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,32 @@ galaxy.short_line_list = {
|
||||||
'fugitiveblame',
|
'fugitiveblame',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gls.mid = {
|
||||||
|
{
|
||||||
|
LSPStatus = {
|
||||||
|
provider = function()
|
||||||
|
local clients = utils.get_active_lsp_client_names()
|
||||||
|
local client_str = ''
|
||||||
|
|
||||||
|
if #clients < 1 then
|
||||||
|
return client_str
|
||||||
|
end
|
||||||
|
|
||||||
|
table.sort(clients)
|
||||||
|
for i, client in ipairs(clients) do
|
||||||
|
client_str = client_str .. client
|
||||||
|
if i < #clients then
|
||||||
|
client_str = client_str .. ', '
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return 'LSP: [' .. client_str .. ']'
|
||||||
|
end,
|
||||||
|
highlight = 'GalaxyText',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
gls.left = {
|
gls.left = {
|
||||||
{
|
{
|
||||||
GhostLeftBracket = {
|
GhostLeftBracket = {
|
||||||
|
@ -139,6 +165,7 @@ gls.left = {
|
||||||
highlight('GalaxyViModeNested', mode_nested, colors.bg)
|
highlight('GalaxyViModeNested', mode_nested, colors.bg)
|
||||||
highlight('GalaxyViModeNestedInv', colors.bg, mode_nested)
|
highlight('GalaxyViModeNestedInv', colors.bg, mode_nested)
|
||||||
highlight('GalaxyPercentBracket', colors.bg, mode_color)
|
highlight('GalaxyPercentBracket', colors.bg, mode_color)
|
||||||
|
highlight('GalaxyText', colors.bg, mode_color)
|
||||||
|
|
||||||
highlight('GalaxyGitLCBracket', mode_nested, mode_color)
|
highlight('GalaxyGitLCBracket', mode_nested, mode_color)
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ highlight('NotifyTRACEIcon', nil, colors.trace)
|
||||||
-- terminal highlight
|
-- terminal highlight
|
||||||
highlight('FloatermBorder', 'None', colors.floatBorder)
|
highlight('FloatermBorder', 'None', colors.floatBorder)
|
||||||
|
|
||||||
|
highlight('StatusLine', 'Normal', 'Normal')
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
highlight clear NormalFloat
|
highlight clear NormalFloat
|
||||||
highlight link NormalFloat Normal
|
highlight link NormalFloat Normal
|
||||||
|
|
|
@ -36,4 +36,14 @@ function M.get_relative_path(file_path)
|
||||||
return './' .. relative_path
|
return './' .. relative_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.get_active_lsp_client_names()
|
||||||
|
local active_clients = vim.lsp.get_active_clients()
|
||||||
|
local client_names = {}
|
||||||
|
for i, client in pairs(active_clients) do
|
||||||
|
table.insert(client_names, i, client.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
return client_names
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Reference in a new issue