refactor(heirline): replace angled NvChad statusline with flat VSCode‑style layout
This commit is contained in:
1 parent
f183c770f3
commit
0c4041d56f
1 file changed
+10
-54
+10
-54
@@ -1,7 +1,7 @@
|
|||||||
--- Custom statusline (heirline via astroui.status components):
|
--- Custom statusline (heirline via astroui.status components):
|
||||||
--- left = NvChad style: angled mode pill, file info pill, git branch/diff
|
--- flat VSCode-style modules — mode text, file info and git on the left;
|
||||||
--- right = VSCode-style info modules, ending in an NvChad mode-colored
|
--- diagnostics, LSP, Ln/Col, Spaces, encoding/EOL and filetype on the right.
|
||||||
--- progress pill (nerd font icon + Top/Bot/percentage)
|
--- No powerline pills or angled separators.
|
||||||
---
|
---
|
||||||
--- NOTE: every nerd-font PUA glyph in this file is written as a \u{XXXX}
|
--- NOTE: every nerd-font PUA glyph in this file is written as a \u{XXXX}
|
||||||
--- Lua escape ON PURPOSE — raw 3-byte PUA glyphs (U+E000-U+F8FF) have been
|
--- Lua escape ON PURPOSE — raw 3-byte PUA glyphs (U+E000-U+F8FF) have been
|
||||||
@@ -14,24 +14,16 @@ return {
|
|||||||
---@type AstroUIOpts
|
---@type AstroUIOpts
|
||||||
opts = {
|
opts = {
|
||||||
icons = {
|
icons = {
|
||||||
VimIcon = "\u{e62b}", -- nf-custom-vim
|
|
||||||
GitBranch = "\u{e725}", -- nf-dev-git_branch
|
GitBranch = "\u{e725}", -- nf-dev-git_branch
|
||||||
GitAdd = "\u{f457}", -- nf-oct-diff_added
|
GitAdd = "\u{f457}", -- nf-oct-diff_added
|
||||||
GitChange = "\u{f459}", -- nf-oct-diff_modified
|
GitChange = "\u{f459}", -- nf-oct-diff_modified
|
||||||
GitDelete = "\u{f458}", -- nf-oct-diff_removed
|
GitDelete = "\u{f458}", -- nf-oct-diff_removed
|
||||||
Progress = "\u{f124}", -- nf-fa-location_arrow
|
|
||||||
-- NvChad diagnostic icons
|
|
||||||
DiagnosticError = "\u{f0159}", -- nf-md-close_circle
|
DiagnosticError = "\u{f0159}", -- nf-md-close_circle
|
||||||
DiagnosticWarn = "\u{f071}", -- nf-fa-warning
|
DiagnosticWarn = "\u{f071}", -- nf-fa-warning
|
||||||
DiagnosticInfo = "\u{f02fc}", -- nf-md-information
|
DiagnosticInfo = "\u{f02fc}", -- nf-md-information
|
||||||
DiagnosticHint = "\u{f06e9}", -- nf-md-lightbulb_on
|
DiagnosticHint = "\u{f06e9}", -- nf-md-lightbulb_on
|
||||||
},
|
},
|
||||||
status = {
|
status = {
|
||||||
-- NvChad-style angled (powerline arrow) separators
|
|
||||||
separators = {
|
|
||||||
left = { "", "\u{e0b0} " }, -- trailing solid right-arrow for left pills
|
|
||||||
right = { " \u{e0b2}", "" }, -- leading solid left-arrow for right pills
|
|
||||||
},
|
|
||||||
colors = function(hl)
|
colors = function(hl)
|
||||||
local get_hlgroup = require("astroui").get_hlgroup
|
local get_hlgroup = require("astroui").get_hlgroup
|
||||||
local comment_fg = get_hlgroup("Comment").fg
|
local comment_fg = get_hlgroup("Comment").fg
|
||||||
@@ -39,8 +31,6 @@ return {
|
|||||||
hl.git_added = comment_fg
|
hl.git_added = comment_fg
|
||||||
hl.git_changed = comment_fg
|
hl.git_changed = comment_fg
|
||||||
hl.git_removed = comment_fg
|
hl.git_removed = comment_fg
|
||||||
hl.blank_bg = get_hlgroup("Folded").fg
|
|
||||||
hl.file_info_bg = get_hlgroup("Visual").bg
|
|
||||||
return hl
|
return hl
|
||||||
end,
|
end,
|
||||||
attributes = {
|
attributes = {
|
||||||
@@ -58,32 +48,20 @@ return {
|
|||||||
opts.statusline = {
|
opts.statusline = {
|
||||||
hl = { fg = "fg", bg = "bg" },
|
hl = { fg = "fg", bg = "bg" },
|
||||||
|
|
||||||
-- ────────────────── left: NvChad ──────────────────
|
-- ────────────────── left ──────────────────
|
||||||
status.component.mode {
|
status.component.mode {
|
||||||
mode_text = {
|
mode_text = { padding = { left = 1, right = 1 } },
|
||||||
icon = { kind = "VimIcon", padding = { right = 1, left = 1 } },
|
|
||||||
},
|
|
||||||
surround = {
|
surround = {
|
||||||
separator = "left",
|
separator = "none",
|
||||||
color = function() return { main = status.hl.mode_bg(), right = "blank_bg" } end,
|
color = function() return { main = status.hl.mode_bg() } end,
|
||||||
},
|
|
||||||
},
|
|
||||||
status.component.builder {
|
|
||||||
{ provider = "" },
|
|
||||||
surround = {
|
|
||||||
separator = "left",
|
|
||||||
color = { main = "blank_bg", right = "file_info_bg" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
status.component.file_info {
|
status.component.file_info {
|
||||||
filename = { fallback = "Empty" },
|
filename = { fallback = "Empty" },
|
||||||
filetype = false,
|
filetype = false,
|
||||||
file_read_only = false,
|
file_read_only = false,
|
||||||
padding = { right = 1 },
|
padding = { left = 1, right = 1 },
|
||||||
surround = {
|
surround = { separator = "none", condition = false },
|
||||||
separator = "left",
|
|
||||||
color = { main = "file_info_bg", right = "bg" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
status.component.git_branch {
|
status.component.git_branch {
|
||||||
git_branch = { padding = { left = 1 } },
|
git_branch = { padding = { left = 1 } },
|
||||||
@@ -96,7 +74,7 @@ return {
|
|||||||
|
|
||||||
status.component.fill(),
|
status.component.fill(),
|
||||||
|
|
||||||
-- ────────────────── right: VSCode info + NvChad progress ──────────────────
|
-- ────────────────── right: VSCode ──────────────────
|
||||||
status.component.diagnostics {
|
status.component.diagnostics {
|
||||||
padding = { right = 1 },
|
padding = { right = 1 },
|
||||||
surround = { separator = "none" },
|
surround = { separator = "none" },
|
||||||
@@ -143,28 +121,6 @@ return {
|
|||||||
padding = { right = 1 },
|
padding = { right = 1 },
|
||||||
surround = { separator = "none", condition = false },
|
surround = { separator = "none", condition = false },
|
||||||
},
|
},
|
||||||
-- NvChad-style progress pill: mode-colored, angled, nerd font icon
|
|
||||||
status.component.builder {
|
|
||||||
{
|
|
||||||
provider = function()
|
|
||||||
local cur, total = vim.fn.line ".", vim.fn.line "$"
|
|
||||||
local pct
|
|
||||||
if cur == 1 then
|
|
||||||
pct = "Top"
|
|
||||||
elseif cur == total then
|
|
||||||
pct = "Bot"
|
|
||||||
else
|
|
||||||
pct = math.floor(cur / total * 100 + 0.5) .. "%%"
|
|
||||||
end
|
|
||||||
return (" %s %s "):format(require("astroui").get_icon "Progress", pct)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
hl = { fg = "bg", bold = true },
|
|
||||||
surround = {
|
|
||||||
separator = "right",
|
|
||||||
color = function() return { main = status.hl.mode_bg(), left = "bg" } end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user