mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
feat(lualine): update statusline
This commit is contained in:
parent
31af25f6a1
commit
845c6a4fe7
2 changed files with 30 additions and 11 deletions
|
@ -12,10 +12,26 @@ local function diff_source()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local statusline_hl = vim.api.nvim_get_hl_by_name("StatusLine", true)
|
||||||
|
local cursorline_hl = vim.api.nvim_get_hl_by_name("CursorLine", true)
|
||||||
|
local normal_hl = vim.api.nvim_get_hl_by_name("Normal", true)
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "SLGitIcon", { fg = "#E8AB53", bg = cursorline_hl.background })
|
||||||
|
vim.api.nvim_set_hl(0, "SLBranchName", { fg = normal_hl.foreground, bg = cursorline_hl.background })
|
||||||
|
vim.api.nvim_set_hl(0, "SLProgress", { fg = "#ECBE7B", bg = statusline_hl.background })
|
||||||
|
|
||||||
|
local location_color = nil
|
||||||
|
local branch = ""
|
||||||
|
|
||||||
|
if lvim.colorscheme == "tokyonight-night" then
|
||||||
|
location_color = "SLBranchName"
|
||||||
|
branch = "%#SLGitIcon#" .. "" .. "%*" .. "%#SLBranchName#"
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mode = {
|
mode = {
|
||||||
function()
|
function()
|
||||||
return " "
|
return " "
|
||||||
end,
|
end,
|
||||||
padding = { left = 0, right = 0 },
|
padding = { left = 0, right = 0 },
|
||||||
color = {},
|
color = {},
|
||||||
|
@ -23,9 +39,8 @@ return {
|
||||||
},
|
},
|
||||||
branch = {
|
branch = {
|
||||||
"b:gitsigns_head",
|
"b:gitsigns_head",
|
||||||
icon = " ",
|
icon = branch,
|
||||||
color = { gui = "bold" },
|
color = { gui = "bold" },
|
||||||
cond = conditions.hide_in_width,
|
|
||||||
},
|
},
|
||||||
filename = {
|
filename = {
|
||||||
"filename",
|
"filename",
|
||||||
|
@ -61,7 +76,7 @@ return {
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = { "nvim_diagnostic" },
|
sources = { "nvim_diagnostic" },
|
||||||
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
||||||
cond = conditions.hide_in_width,
|
-- cond = conditions.hide_in_width,
|
||||||
},
|
},
|
||||||
treesitter = {
|
treesitter = {
|
||||||
function()
|
function()
|
||||||
|
@ -111,8 +126,14 @@ return {
|
||||||
color = { gui = "bold" },
|
color = { gui = "bold" },
|
||||||
cond = conditions.hide_in_width,
|
cond = conditions.hide_in_width,
|
||||||
},
|
},
|
||||||
location = { "location", cond = conditions.hide_in_width, color = {} },
|
location = { "location", color = location_color },
|
||||||
progress = { "progress", cond = conditions.hide_in_width, color = {} },
|
progress = {
|
||||||
|
"progress",
|
||||||
|
fmt = function()
|
||||||
|
return "%P/%L"
|
||||||
|
end,
|
||||||
|
color = {},
|
||||||
|
},
|
||||||
spaces = {
|
spaces = {
|
||||||
function()
|
function()
|
||||||
if not vim.api.nvim_buf_get_option(0, "expandtab") then
|
if not vim.api.nvim_buf_get_option(0, "expandtab") then
|
||||||
|
@ -144,7 +165,7 @@ return {
|
||||||
return chars[index]
|
return chars[index]
|
||||||
end,
|
end,
|
||||||
padding = { left = 0, right = 0 },
|
padding = { left = 0, right = 0 },
|
||||||
color = { fg = colors.yellow, bg = colors.bg },
|
color = "SLProgress",
|
||||||
cond = nil,
|
cond = nil,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,6 @@ styles.lvim = {
|
||||||
},
|
},
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
components.branch,
|
components.branch,
|
||||||
components.filename,
|
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
components.diff,
|
components.diff,
|
||||||
|
@ -88,13 +87,12 @@ styles.lvim = {
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
components.diagnostics,
|
components.diagnostics,
|
||||||
components.treesitter,
|
|
||||||
components.lsp,
|
components.lsp,
|
||||||
components.filetype,
|
components.filetype,
|
||||||
},
|
},
|
||||||
lualine_y = {},
|
lualine_y = { components.location },
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
components.scrollbar,
|
components.progress,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
|
|
Loading…
Reference in a new issue