diff --git a/.config/nvim/.github/overview-images/lualine.png b/.config/nvim/.github/overview-images/lualine.png index 90060694..054819b1 100644 Binary files a/.config/nvim/.github/overview-images/lualine.png and b/.config/nvim/.github/overview-images/lualine.png differ diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 72567f07..7f5e4300 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,22 +1,28 @@ local lsp = function() - local buf_clients = vim.lsp.get_active_clients({ bufnr = 0 }) + local buf_clients = vim.lsp.get_clients({ bufnr = 0 }) if #buf_clients == 0 then - return "LSP Inactive" + return "" + else + return " " end +end - local buf_client_names = {} - - -- add client - for _, client in pairs(buf_clients) do - if client.name ~= "null-ls" and client.name ~= "copilot" then - table.insert(buf_client_names, client.name) - end +local formatter = function() + local formatters = require("conform").list_formatters(0) + if #formatters == 0 then + return "" + else + return "󰛖 " end +end - local unique_client_names = table.concat(buf_client_names, ", ") - local language_servers = string.format(" %s", unique_client_names) - - return language_servers +local linter = function() + local linters = require("lint").linters_by_ft[vim.bo.filetype] + if #linters == 0 then + return "" + else + return "󱉶 " + end end return { @@ -27,6 +33,8 @@ return { table.remove(opts.sections.lualine_x, 1) table.insert(opts.sections.lualine_x, 2, lsp) + table.insert(opts.sections.lualine_x, 2, formatter) + table.insert(opts.sections.lualine_x, 2, linter) opts.sections.lualine_a = { { "mode", icon = "" } } opts.sections.lualine_y = { { "progress", icon = "", separator = " ", padding = { left = 1, right = 1 } } } opts.sections.lualine_z = { { "location", icon = "", padding = { left = 1, right = 1 } } }