1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

nvim/lua/user/plugins/ui/statusline.lua: update

This commit is contained in:
Henrik Hautakoski 2024-12-17 22:57:11 +01:00
parent d6533309c0
commit 683c1a95cc

View file

@ -14,6 +14,18 @@ local function is_not_popup()
return not vim.tbl_contains(types, vim.bo.filetype) return not vim.tbl_contains(types, vim.bo.filetype)
end end
local function linter()
local ok, lint = pcall(require, "lint")
if ok then
local linters = lint.get_running()
if #linters == 0 then
return "󰦕"
end
return "󱉶 " .. table.concat(linters, ", ")
end
return "no linter"
end
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
event = "VeryLazy", event = "VeryLazy",
@ -37,7 +49,6 @@ return {
"alpha" "alpha"
} }
}, },
-- theme = "catppuccin"
theme = { theme = {
normal = { normal = {
a = "StatusLineNormal", a = "StatusLineNormal",
@ -71,19 +82,6 @@ return {
}, },
lualine_b = { lualine_b = {
{"branch"}, {"branch"},
{
"lsp-status",
disabled_filetypes = {
"TelescopePrompt",
},
on_click = function (_, btn, _)
if btn == "l" then
vim.cmd(":LspInfo")
elseif btn == "r" then
vim.cmd(":LspRestart")
end
end
},
{ {
"diagnostics", "diagnostics",
symbols = { symbols = {
@ -103,14 +101,20 @@ return {
}, },
}, },
lualine_c = { lualine_c = {
{ {
"filename", "lsp-status",
cond = is_not_popup, disabled_filetypes = {
path = 1, "TelescopePrompt",
symbols = vim.tbl_deep_extend("force", icons.file_status, { },
unnamed = "", on_click = function (_, btn, _)
}) if btn == "l" then
}, vim.cmd(":LspInfo")
elseif btn == "r" then
vim.cmd(":LspRestart")
end
end
},
linter,
}, },
lualine_x = { lualine_x = {
{ {
@ -129,14 +133,28 @@ return {
winbar = { winbar = {
lualine_c = { lualine_c = {
{ "filetype", icon_only = true }, { "filetype", icon_only = true },
"filename", {
"filename",
cond = is_not_popup,
path = 1,
symbols = vim.tbl_deep_extend("force", icons.file_status, {
unnamed = "",
})
},
}, },
}, },
inactive_winbar = { inactive_winbar = {
lualine_c = { lualine_c = {
{ "filetype", icon_only = true }, { "filetype", icon_only = true },
"filename", {
}, "filename",
cond = is_not_popup,
path = 1,
symbols = vim.tbl_deep_extend("force", icons.file_status, {
unnamed = "",
})
},
},
}, },
extensions = { extensions = {
"lazy", "lazy",