summaryrefslogtreecommitdiff
path: root/lua/mo/statusline.lua
blob: b24436c1a235594a5605c6f88dfbc98c176614e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- local function lsp_status()
--   local clients = vim.lsp.get_active_clients({ bufnr = 0 })
--   if #clients == 0 then return "" end
--   local names = {}
--   for _, client in ipairs(clients) do
--     table.insert(names, client.name)
--   end
--   return "[" .. table.concat(names, ", ") .. "]"
-- end

local M = {}

function M.lsp_status()
    local clients = vim.lsp.get_clients({ bufnr = 0 })
    if #clients == 0 then return "" end

    return "%#StatusLineLsp#[" .. table.concat(vim.tbl_map(function(client) return client.name end, clients), ",") .. "]%*  "
end

return M