From 03f5f3f8bef35208c1fe12c9a4ed5ebe2c9ebb44 Mon Sep 17 00:00:00 2001 From: marshmallow Date: Tue, 27 May 2025 11:28:32 +1000 Subject: [PATCH] drop gitsigns --- candy/lua/marshmallow/files.lua | 4 ++-- candy/lua/marshmallow/git.lua | 9 +++++---- candy/lua/marshmallow/statusline.lua | 17 +---------------- flake.nix | 1 - 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/candy/lua/marshmallow/files.lua b/candy/lua/marshmallow/files.lua index afc7461..54ce83c 100644 --- a/candy/lua/marshmallow/files.lua +++ b/candy/lua/marshmallow/files.lua @@ -67,7 +67,7 @@ vim.api.nvim_create_autocmd("User", { -- first number in the string is the number of files changed table.insert(changes, { "~" .. string.match(obj.stdout, "%d"), - "GitSignsChange", + "MiniDiffSignChange", }) end @@ -77,7 +77,7 @@ vim.api.nvim_create_autocmd("User", { table.insert(changes, { change .. number, - change == "-" and "GitSignsDelete" or "GitSignsAdd", + change == "-" and "MiniDiffSignDelete" or "MiniDiffSignAdd", }) end diff --git a/candy/lua/marshmallow/git.lua b/candy/lua/marshmallow/git.lua index 10a2553..5e08290 100644 --- a/candy/lua/marshmallow/git.lua +++ b/candy/lua/marshmallow/git.lua @@ -1,5 +1,6 @@ -require("gitsigns").setup({ - attach_to_untracked = true, - current_line_blame = false, - signs_staged_enable = true, +require("mini.diff").setup({ + view = { + style = "sign", + signs = { add = "+", change = "~", delete = "-" }, + }, }) diff --git a/candy/lua/marshmallow/statusline.lua b/candy/lua/marshmallow/statusline.lua index 82c0b21..f957594 100644 --- a/candy/lua/marshmallow/statusline.lua +++ b/candy/lua/marshmallow/statusline.lua @@ -69,22 +69,7 @@ local function finish() end local function git() - local status = vim.b.gitsigns_status_dict - if status == nil then - return " " - end - - local has_changes = status.added ~= 0 or status.removed ~= 0 or status.changed ~= 0 - local added_count = status.added or 0 - local removed_count = status.removed or 0 - local changed_count = status.removed or 0 - - local added = added_count > 0 and ("%#GitSignsAdd#+" .. added_count .. "%*") or "" - local removed = removed_count > 0 and ("%#GitSignsDelete#-" .. removed_count .. "%*") or "" - local changed = changed_count > 0 and ("%#GitSignsChange#~" .. changed_count .. "%*") or "" - local changes = "(" .. added .. removed .. changed .. "%#StatusHead#)%*" - - return " %#StatusHead#" .. status.head .. (has_changes and changes or "") .. "%*" + return " %{FugitiveStatusline()} " end local function first() diff --git a/flake.nix b/flake.nix index e34888d..e11fafc 100644 --- a/flake.nix +++ b/flake.nix @@ -105,7 +105,6 @@ vim-dotenv (opt nvim-spider) vim-fugitive - gitsigns-nvim vim-gnupg fidget-nvim presence-nvim -- 2.51.2