You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add +N ~N -N hunk counts to the statusline's git section, sourced from vim.b.gitsigns_status_dict — the same buffer-local variable that already powers the branch name display.
Where
lua/config/statusline.lua:27-33 — the current_git_branch() function.
Why it matters
The statusline already reads vim.b.gitsigns_head for the branch name. gitsigns also populates vim.b.gitsigns_status_dict with { added = N, changed = N, removed = N } for free — no extra API calls. Adding the counts gives a quick at-a-glance diff summary without opening fugitive or running :Gstatus.
This is especially useful during the iterative edit-format-commit cycle across the six active LSP languages (Lua, Python, TypeScript, Rust, Go, Swift), where knowing "I have 5 additions and 2 changes in this buffer" is a constant need.
Colors can be split per-segment (green +, yellow ~, red -) using additional highlight groups if desired, but a single %#Git# block is the simplest starting point.
What
Add
+N ~N -Nhunk counts to the statusline's git section, sourced fromvim.b.gitsigns_status_dict— the same buffer-local variable that already powers the branch name display.Where
lua/config/statusline.lua:27-33— thecurrent_git_branch()function.Why it matters
The statusline already reads
vim.b.gitsigns_headfor the branch name. gitsigns also populatesvim.b.gitsigns_status_dictwith{ added = N, changed = N, removed = N }for free — no extra API calls. Adding the counts gives a quick at-a-glance diff summary without opening fugitive or running:Gstatus.This is especially useful during the iterative edit-format-commit cycle across the six active LSP languages (Lua, Python, TypeScript, Rust, Go, Swift), where knowing "I have 5 additions and 2 changes in this buffer" is a constant need.
Sketch
The diff string is omitted when all counts are zero (clean buffer), keeping the statusline tidy for unmodified files.
Notes
vim.b.gitsigns_status_dictis populated automatically.+, yellow~, red-) using additional highlight groups if desired, but a single%#Git#block is the simplest starting point.