From 261453871bed87e05522596e2707a1a7d3983781 Mon Sep 17 00:00:00 2001 From: Imbus Date: Thu, 5 Mar 2026 17:23:53 +0100 Subject: [PATCH] Remove gitsigns in favor of mini.diff --- lua/plugins/gitsigns.lua | 62 ---------------------------------------- lua/plugins/mini.lua | 13 +++++++++ 2 files changed, 13 insertions(+), 62 deletions(-) delete mode 100644 lua/plugins/gitsigns.lua diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua deleted file mode 100644 index 19cb01c..0000000 --- a/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,62 +0,0 @@ --- Adds git related signs to the gutter, as well as utilities for managing changes --- See: https://github.com/lewis6991/gitsigns.nvim?tab=readme-ov-file#installation--usage - -return { - { - 'lewis6991/gitsigns.nvim', - opts = { - current_line_blame = true, -- Show blame for current line - - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis '@' - end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) - end, - }, - }, -} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 3280113..7b725d3 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -46,6 +46,19 @@ return { -- Collection of various small independent plugins/modules }, } + -- Unused for now + -- require('mini.git').setup {} + + -- Helpful diffs, replaces gitsigns + -- see: https://nvim-mini.org/mini.nvim/doc/mini-diff.html#module-highlightgroups + require('mini.diff').setup { + view = { + style = 'sign', + -- signs = { add = '▒', change = '▒', delete = '▒' }, + -- signs = { add = '|', change = '|', delete = '|' }, + }, + } + -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin