summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua/statusline.lua
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-08-05 22:23:24 -0400
committertriethyl <triethylammonium@pm.me>2025-08-05 22:23:24 -0400
commite7fc04e57690eaa993b0d4219fb96355ed65e5cd (patch)
tree149909503ef61271b74fc9cded8bc8d7eaaa2361 /pkgs/custom-neovim/config/lua/statusline.lua
parent6a066d077feb6bed1c4a324c969b19773571e690 (diff)
neovim: add git status statusline component
Diffstat (limited to 'pkgs/custom-neovim/config/lua/statusline.lua')
-rw-r--r--pkgs/custom-neovim/config/lua/statusline.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua
index 1e5c708..5fcf7eb 100644
--- a/pkgs/custom-neovim/config/lua/statusline.lua
+++ b/pkgs/custom-neovim/config/lua/statusline.lua
@@ -158,6 +158,14 @@ statusline_components.git_branch = function()
end
end
+statusline_components.git_status = function()
+ if vim.b.gitsigns_status then
+ return string.format(' %s ', vim.b.gitsigns_status)
+ else
+ return ''
+ end
+end
+
statusline_components.working_directory = function()
local text = vim.fn.getcwd()
@@ -198,6 +206,7 @@ local statusline = {
get_component("mode"),
get_component("working_directory"),
get_component("git_branch"),
+ get_component("git_status"),
get_component("diagnostic_status"),
get_component("spacer"),