Better status line

This commit is contained in:
alejo committed 2026-08-31 20:26:49 -03:00
1 parent 39cbfea234
commit 948a335ed9
2 files changed
+116 -9

No files matched your search

+8 -1
View File
@@ -85,7 +85,14 @@ Package names vary by distro (see the script for the exact list per package mana
- **Theme**: `tokyonight` (night variant), customized to a pure black background, with custom colors for error/warn/info/hint diagnostic virtual lines.
- **Dashboard**: `alpha-nvim` start screen with quick actions — find file, recent files, live grep, new file, edit config, quit.
- **Statusline**: `lualine`, themed to match, shows mode, git branch, diagnostics, filename, encoding/filetype, progress, and cursor location.
- **Statusline**: `lualine`, styled with true Powerline arrow separators (the seamless, edge-to-edge kind — between sections, a thinner version between components within a section). Left to right:
- Mode, plus a macro-recording indicator (`● REC @<register>`) that only appears while a macro is actually being recorded.
- Git branch and a diff summary (added/changed/removed), grouped together as one git cluster instead of being split across the line.
- File-type icon fused directly to the filename with no separator between them — it reads as one unit rather than a boxed-off icon — plus a `●` for unsaved changes and `[RO]` for read-only buffers.
- Search count, diagnostics, the name(s) of any attached LSP client(s), and a word count that only shows up on prose filetypes (markdown, text, tex, commit messages).
- Progress, cursor location, and the file's encoding/line-ending — but only when they differ from Neovim's own defaults (utf-8, unix), so a normal file doesn't clutter the line confirming the obvious.
- A clock with the abbreviated weekday.
- The Powerline glyphs live in the E0B0–E0B3 Unicode range, part of the same Nerd Font patch as the file/branch icons elsewhere in the statusline — if the icons render, the arrows will too. If they instead show as boxes or `?`, it means the terminal's font setting isn't pointed at the *patched* font family specifically (Nerd Fonts rename it, e.g. "CaskaydiaCove Nerd Font" rather than plain "Cascadia Code"). Verify with `echo -e "\ue0b0"` in a terminal, outside Neovim entirely — if that's blank, fix the terminal's font setting rather than the config.
- **Indent guides**: `indent-blankline` — colored guide per indent level, plus the current lexical scope (the block your cursor is inside) is highlighted with its own guide color. The underline that used to mark the scope's start/end line is disabled (`show_start`/`show_end = false`) — just the colored guide remains.
- **Inline color previews**: `nvim-colorizer` shows hex/rgb color values with their actual color as a background.
- **Notifications**: `nvim-notify` replaces the default notification popups with floating, styled ones, positioned bottom-right.
+108 -8
View File
@@ -1047,17 +1047,117 @@ return {
require("lualine").setup({
options = {
theme = "tokyonight",
component_separators = { left = "│", right = "│" },
section_separators = { left = "", right = "" },
-- Powerline private-use-area glyphs (E0B0-E0B3). This needs
-- the terminal's font actually set to the PATCHED family
-- (e.g. "JetBrainsMono Nerd Font" / "CaskaydiaCove Nerd
-- Font", not plain "JetBrains Mono"/"Cascadia Code") -- if
-- these render as boxes/question marks, that's the fix.
-- The thin variants (E0B1/E0B3) are used between components
-- within a section so they pick up each component's colors
-- instead of a fixed one.
-- Powerline glyphs U+E0B0-U+E0B3, written as raw UTF-8 byte
-- escapes (not literal characters) so they can't get
-- silently stripped by an editor/tool that mishandles
-- Private Use Area codepoints.
component_separators = { left = "\238\130\177", right = "\238\130\179" },
section_separators = { left = "\238\130\176", right = "\238\130\178" },
globalstatus = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diagnostics" },
lualine_c = { { "filename", path = 1 } },
lualine_x = { "encoding", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
lualine_a = {
"mode",
-- Only appears while recording a macro -- `cond` hides
-- the component (and its separator) entirely the rest of
-- the time, so it doesn't sit there empty.
{
function()
return "\226\151\143 REC @" .. vim.fn.reg_recording()
end,
cond = function()
return vim.fn.reg_recording() ~= ""
end,
color = { fg = "#e0af68", gui = "bold" },
},
},
lualine_b = {
-- Icon is baked into lualine's own "branch" component --
-- nothing authored here, so no glyph-encoding risk.
{ "branch" },
-- Moved in next to branch (was in lualine_x) so all the
-- git state reads as one cluster instead of being split
-- across opposite ends of the line.
{ "diff" },
},
lualine_c = {
-- separator = "" fuses this to the filename that follows
-- instead of leaving the icon boxed off by its own arrow
-- on both sides.
{ "filetype", icon_only = true, padding = { left = 1, right = 0 }, separator = "" },
{
"filename",
path = 0,
symbols = { modified = " \226\151\143", readonly = " [RO]", unnamed = "[No Name]" },
},
},
lualine_x = {
"searchcount",
"diagnostics",
-- Attached LSP client name(s) -- hidden via `cond` when
-- nothing's attached to the buffer.
{
function()
local names = {}
for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do
table.insert(names, client.name)
end
return "\239\128\147 " .. table.concat(names, ", ")
end,
cond = function()
return #vim.lsp.get_clients({ bufnr = 0 }) > 0
end,
},
-- Word count, only for prose filetypes -- noise anywhere
-- else, so it's gated the same way.
{
function()
return "\194\182 " .. vim.fn.wordcount().words
end,
cond = function()
local ft = vim.bo.filetype
return ft == "markdown" or ft == "text" or ft == "gitcommit" or ft == "tex"
end,
},
},
lualine_y = {
"progress",
"location",
-- Encoding/line-ending: only shown when they DIFFER from
-- Neovim's own defaults (utf-8, unix) -- surfaces the
-- unusual case instead of confirming the boring default
-- on every single file.
{
function()
local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding
local parts = {}
if enc ~= "utf-8" then
table.insert(parts, enc)
end
if vim.bo.fileformat ~= "unix" then
table.insert(parts, vim.bo.fileformat)
end
return table.concat(parts, " ")
end,
cond = function()
local enc = vim.bo.fileencoding ~= "" and vim.bo.fileencoding or vim.o.encoding
return enc ~= "utf-8" or vim.bo.fileformat ~= "unix"
end,
},
},
lualine_z = {
function()
return " " .. os.date("%a %H:%M")
end,
},
},
})
end,