diff --git a/nvim/.config/nvim/after/plugin/mini.lua b/nvim/.config/nvim/after/plugin/mini.lua index 4c7dc52..d47b18c 100644 --- a/nvim/.config/nvim/after/plugin/mini.lua +++ b/nvim/.config/nvim/after/plugin/mini.lua @@ -3,6 +3,22 @@ local opts = { noremap=true, silent=true, unique=true } -- Comment lines require('mini.comment').setup() +-- Diff hunks +require('mini.diff').setup({ + view = { + style = 'sign', + signs = { add = '+', change = '~', delete = '-' }, + }, + mappings = { + textobject = 'gh', + goto_prev = '[c', + goto_next = ']c', + goto_first = 'hf', + goto_last = 'hl', + apply = 'hs', + reset = 'hr', + }, +}) -- File System require('mini.files').setup({ mappings = { diff --git a/nvim/.config/nvim/after/plugin/statusline.lua b/nvim/.config/nvim/after/plugin/statusline.lua index 5768754..8da138c 100644 --- a/nvim/.config/nvim/after/plugin/statusline.lua +++ b/nvim/.config/nvim/after/plugin/statusline.lua @@ -136,19 +136,18 @@ M.get_git_branch = function(self) end M.get_git_status = function(self) - local signs = vim.b.gitsigns_status_dict - or { head = "", added = 0, changed = 0, removed = 0 } - local is_head_empty = signs.head ~= "" + local is_git = fn.FugitiveHead() ~= "" + local signs = vim.b.minidiff_summary or { add = 0, change = 0, delete = 0 } - return is_head_empty + return is_git and string.format( " %s+%s %s~%s %s-%s", "%#DiffAdded#", - signs.added or 0, + signs.add, "%#DiffChanged#", - signs.changed or 0, + signs.change, "%#DiffRemoved#", - signs.removed or 0 + signs.delete ) or "" end @@ -204,8 +203,10 @@ M.progress = function() end M.git_ahead_behind_status = function() + local is_git = fn.FugitiveHead() ~= "" + return - vim.b.gitsigns_status_dict + is_git and string.format(" %s%s%d%s%d", '%#GitStatus#', '  ', gstatus.behind, '  ', gstatus.ahead) or ""