summaryrefslogtreecommitdiffstats
path: root/lua/conf/opts.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/conf/opts.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(), " ",