add a lil guy who provides git information on the current buffer

This commit is contained in:
2025-05-09 17:56:06 -05:00
parent 922dfb8c7e
commit 77130d61af

View File

@ -141,6 +141,33 @@ do -- statusline
return out
end
--- get git status information
---@return string out git status information or nothing
local function gitsigns()
local reset = "%#StatusLine#"
local hl = reset
local lil_guy = "o/"
---@type table
local status = vim.b.gitsigns_status_dict
if not status then
return ""
end
if status.removed and status.removed > 0 then
hl = "%#GitSignsDelete#"
lil_guy = "<o>"
elseif status.changed and status.changed > 0 then
hl = "%#GitSignsChange#"
lil_guy = "o7"
elseif status.added and status.added > 0 then
hl = "%#GitSignsAdd#"
lil_guy = "\\o/"
end
return hl..lil_guy..reset
end
return table.concat {
"%t", -- file name
" %h", -- help buffer tag
@ -148,6 +175,8 @@ do -- statusline
"%r", -- readonly flag
"%=", -- seperate left and right side
-- print out git status information in the form of a lil guy
gitsigns(), " ",
-- print out the number of lsp clients attached with nice colors :)
lsp_servers(), " ",