summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-09 17:56:06 -0500
committerSquibid <me@zacharyscheiman.com>2025-05-09 17:58:06 -0500
commit77130d61af1e88855e273d042714f90323e04edf (patch)
treedc5a8375fd8fe88a7ccb3b07e8bb6dd5cce5f38f /lua
parent922dfb8c7ee7fe5a88dc569220ea92aff659fa08 (diff)
downloadnvim-77130d61af1e88855e273d042714f90323e04edf.tar.gz
nvim-77130d61af1e88855e273d042714f90323e04edf.tar.bz2
nvim-77130d61af1e88855e273d042714f90323e04edf.zip
add a lil guy who provides git information on the current buffer
Diffstat (limited to 'lua')
-rw-r--r--lua/conf/opts.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/lua/conf/opts.lua b/lua/conf/opts.lua
index 48792bb..dc2c3e7 100644
--- a/lua/conf/opts.lua
+++ b/lua/conf/opts.lua
@@ -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(), " ",