From e7fc04e57690eaa993b0d4219fb96355ed65e5cd Mon Sep 17 00:00:00 2001 From: triethyl Date: Tue, 5 Aug 2025 22:23:24 -0400 Subject: neovim: add git status statusline component --- pkgs/custom-neovim/config/lua/statusline.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/custom-neovim/config/lua/statusline.lua') 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"), -- cgit v1.2.3