From 90b4dd37e1a421bd985f276d835d4e3220ed3063 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 1 Sep 2024 14:38:40 +0200 Subject: [PATCH] nvim/lua/user/plugins/ui/statusline.lua: use pnx/lualine-lsp-status instead of local function. --- nvim/lua/user/plugins/ui/statusline.lua | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/nvim/lua/user/plugins/ui/statusline.lua b/nvim/lua/user/plugins/ui/statusline.lua index 13a103f..99f1d3a 100644 --- a/nvim/lua/user/plugins/ui/statusline.lua +++ b/nvim/lua/user/plugins/ui/statusline.lua @@ -6,17 +6,13 @@ local function indent_settings() .. (vim.bo.shiftwidth == 0 and vim.bo.tabstop or vim.bo.shiftwidth) end -local function lsp_info() - local num_clients = tostring(#vim.tbl_keys(vim.lsp.get_clients())) - return " " .. num_clients -end - return { "nvim-lualine/lualine.nvim", event = "VeryLazy", dependencies = { + "nvim-tree/nvim-web-devicons", "arkav/lualine-lsp-progress", - "nvim-tree/nvim-web-devicons", + "pnx/lualine-lsp-status", }, opts = { options = { @@ -32,6 +28,7 @@ return { "neo-tree", } }, + -- theme = "catppuccin" theme = { normal = { a = "StatusLineNormal", @@ -67,9 +64,18 @@ return { }, }, lualine_b = { - "branch", - -- '" " .. tostring(#vim.tbl_keys(vim.lsp.buf_get_clients()))', - lsp_info, + {"branch"}, + { + "lsp-status", + colors = {}, + on_click = function (_, btn, _) + if btn == "l" then + vim.cmd(":LspInfo") + elseif btn == "r" then + vim.cmd(":LspRestart") + end + end + }, { "diagnostics", symbols = {