(nvim) ran formatter on lualine

This commit is contained in:
zegonix
2025-06-08 23:42:57 +02:00
parent 46b6d259f9
commit 422753f9e7

View File

@@ -1,157 +1,157 @@
-- Set lualine as statusline -- Set lualine as statusline
return { return {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
config = function() config = function()
-- adapted from zegonix' alacritty theme, apart from the grays, which have been copied from wegmanma's config -- adapted from zegonix' alacritty theme, apart from the grays, which have been copied from wegmanma's config
local colors = { local colors = {
black = "#181820", black = "#181820",
red = "#E00010", red = "#E00010",
green = "#34AD1F", green = "#34AD1F",
yellow = "#E1D719", yellow = "#E1D719",
blue = "#2B58D4", blue = "#2B58D4",
magenta = "#E02482", magenta = "#E02482",
purple = "#9018E0", purple = "#9018E0",
cyan = "#15D7E5", cyan = "#15D7E5",
white = "#E0E0E0", white = "#E0E0E0",
dim_black = "#2C2C3C", dim_black = "#2C2C3C",
dim_red = "#FF4054", dim_red = "#FF4054",
dim_green = "#6CC868", dim_green = "#6CC868",
dim_yellow = "#E8DC80", dim_yellow = "#E8DC80",
dim_blue = "#709FE3", dim_blue = "#709FE3",
dim_magenta = "#FBB0DD", dim_magenta = "#FBB0DD",
dim_cyan = "#60D7E1", dim_cyan = "#60D7E1",
dim_white = "#C0C0C0", dim_white = "#C0C0C0",
fg = "#E0E0E0", fg = "#E0E0E0",
bg = "#181820", bg = "#181820",
gray1 = "#54546D", gray1 = "#54546D",
gray2 = "#343446", gray2 = "#343446",
gray3 = "#2A2A37", gray3 = "#2A2A37",
} }
local kanagawa_paper = { local kanagawa_paper = {
normal = { normal = {
a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" }, a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" },
b = { fg = colors.fg, bg = colors.gray2 }, b = { fg = colors.fg, bg = colors.gray2 },
c = { fg = colors.fg, bg = colors.bg }, c = { fg = colors.fg, bg = colors.bg },
}, },
command = { a = { fg = colors.bg, bg = colors.yellow, gui = "bold" } }, command = { a = { fg = colors.bg, bg = colors.yellow, gui = "bold" } },
insert = { a = { fg = colors.bg, bg = colors.blue, gui = "bold" } }, insert = { a = { fg = colors.bg, bg = colors.blue, gui = "bold" } },
visual = { a = { fg = colors.bg, bg = colors.purple, gui = "bold" } }, visual = { a = { fg = colors.bg, bg = colors.purple, gui = "bold" } },
terminal = { a = { fg = colors.bg, bg = colors.cyan, gui = "bold" } }, terminal = { a = { fg = colors.bg, bg = colors.cyan, gui = "bold" } },
replace = { a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" } }, replace = { a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" } },
inactive = { inactive = {
a = { fg = colors.gray1, bg = colors.bg, gui = "bold" }, a = { fg = colors.gray1, bg = colors.bg, gui = "bold" },
b = { fg = colors.gray1, bg = colors.bg }, b = { fg = colors.gray1, bg = colors.bg },
c = { fg = colors.gray1, bg = colors.gray3 }, c = { fg = colors.gray1, bg = colors.gray3 },
}, },
} }
local mama_mia = { local mama_mia = {
normal = { normal = {
a = { fg = colors.bg, bg = colors.dim_blue, gui = "bold" }, a = { fg = colors.bg, bg = colors.dim_blue, gui = "bold" },
b = { fg = colors.fg, bg = colors.gray1 }, b = { fg = colors.fg, bg = colors.gray1 },
c = { fg = colors.fg, bg = colors.gray3 }, c = { fg = colors.fg, bg = colors.gray3 },
}, },
command = { a = { fg = colors.bg, bg = colors.dim_yellow, gui = "bold" } }, command = { a = { fg = colors.bg, bg = colors.dim_yellow, gui = "bold" } },
insert = { a = { fg = colors.bg, bg = colors.dim_magenta, gui = "bold" } }, insert = { a = { fg = colors.bg, bg = colors.dim_magenta, gui = "bold" } },
visual = { a = { fg = colors.bg, bg = colors.dim_cyan, gui = "bold" } }, visual = { a = { fg = colors.bg, bg = colors.dim_cyan, gui = "bold" } },
terminal = { a = { fg = colors.bg, bg = colors.dim_green, gui = "bold" } }, terminal = { a = { fg = colors.bg, bg = colors.dim_green, gui = "bold" } },
replace = { a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" } }, replace = { a = { fg = colors.bg, bg = colors.dim_red, gui = "bold" } },
inactive = { inactive = {
a = { fg = colors.fg, bg = colors.bg, gui = "bold" }, a = { fg = colors.fg, bg = colors.bg, gui = "bold" },
b = { fg = colors.fg, bg = colors.bg }, b = { fg = colors.fg, bg = colors.bg },
c = { fg = colors.fg, bg = colors.gray2 }, c = { fg = colors.fg, bg = colors.gray2 },
}, },
} }
-- local kanagawa_paper = require("themes.kanagawa-paper") -- local kanagawa_paper = require("themes.kanagawa-paper")
-- Import color theme based on environment variable NVIM_THEME -- Import color theme based on environment variable NVIM_THEME
local env_var_nvim_theme = "mama_mia" local env_var_nvim_theme = "mama_mia"
-- Define a table of themes -- Define a table of themes
local themes = { local themes = {
kanagawa_paper = kanagawa_paper, kanagawa_paper = kanagawa_paper,
mama_mia = mama_mia, mama_mia = mama_mia,
} }
local mode = { local mode = {
"mode", "mode",
fmt = function(str) fmt = function(str)
return str return str
end, end,
} }
local filename = { local filename = {
"filename", "filename",
file_status = true, -- displays file status (readonly status, modified status) file_status = true, -- displays file status (readonly status, modified status)
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
} }
local hide_in_width = function() local hide_in_width = function()
return vim.fn.winwidth(0) > 100 return vim.fn.winwidth(0) > 100
end end
local diagnostics = { local diagnostics = {
"diagnostics", "diagnostics",
sources = { "nvim_diagnostic" }, sources = { "nvim_diagnostic" },
sections = { "error", "warn" }, sections = { "error", "warn" },
symbols = { error = "", warn = "", info = "", hint = "" }, symbols = { error = "", warn = "", info = "", hint = "" },
colored = false, colored = false,
update_in_insert = false, update_in_insert = false,
always_visible = false, always_visible = false,
cond = hide_in_width, cond = hide_in_width,
} }
local diff = { local diff = {
"diff", "diff",
colored = false, colored = false,
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
cond = hide_in_width, cond = hide_in_width,
} }
require("lualine").setup({ require("lualine").setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
theme = themes[env_var_nvim_theme], -- Set theme based on environment variable theme = themes[env_var_nvim_theme], -- Set theme based on environment variable
-- Some useful glyphs: -- Some useful glyphs:
-- https://www.nerdfonts.com/cheat-sheet -- https://www.nerdfonts.com/cheat-sheet
--         --        
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
component_separators = { left = ":", right = ":" }, component_separators = { left = ":", right = ":" },
disabled_filetypes = { "alpha", "neo-tree", "Avante" }, disabled_filetypes = { "alpha", "neo-tree", "Avante" },
always_divide_middle = true, always_divide_middle = true,
}, },
sections = { sections = {
lualine_a = { mode }, lualine_a = { mode },
lualine_b = { "branch" }, lualine_b = { "branch" },
lualine_c = { filename }, lualine_c = { filename },
lualine_x = { lualine_x = {
diagnostics, diagnostics,
--diff, --diff,
{ "encoding", cond = hide_in_width }, { "encoding", cond = hide_in_width },
{ "filetype", cond = hide_in_width }, { "filetype", cond = hide_in_width },
}, },
lualine_y = { "location" }, lualine_y = { "location" },
lualine_z = { "progress" }, lualine_z = { "progress" },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { { "filename", path = 1 } }, lualine_c = { { "filename", path = 1 } },
lualine_x = { { "location", padding = 0 } }, lualine_x = { { "location", padding = 0 } },
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
tabline = { tabline = {
lualine_a = { "buffers" }, lualine_a = { "buffers" },
lualine_b = {}, lualine_b = {},
lualine_c = {}, lualine_c = {},
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
extensions = { "fugitive" }, extensions = { "fugitive" },
}) })
end, end,
} }