From da83f9ebcb15c28cc51abfe084486e874558730f Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Mon, 12 Oct 2026 22:49:00 +0200 Subject: [PATCH] nvim gitsigns refresh --- CONFIG/nvim/init.lua | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/CONFIG/nvim/init.lua b/CONFIG/nvim/init.lua index d28db77..d8d35ff 100644 --- a/CONFIG/nvim/init.lua +++ b/CONFIG/nvim/init.lua @@ -833,10 +833,7 @@ local function makespec_diffview() "DiffviewRefresh", "DiffviewFileHistory", }, - keys = { - { "gd", "DiffviewOpen", desc = "DiffView Tab" }, - { "gh", "DiffviewFileHistory", desc = "File History Tab" }, - }, + keys = {}, } end local function makespec_fugitive() @@ -884,6 +881,7 @@ local function makespec_gitsigns() vim.cmd.normal({ "]c", bang = true }) else gs.nav_hunk("next") + vim.schedule(gs.preview_hunk_inline) end end local function prev_hunk() @@ -891,14 +889,14 @@ local function makespec_gitsigns() vim.cmd.normal({ "[c", bang = true }) else gs.nav_hunk("prev") + vim.schedule(gs.preview_hunk_inline) end end - local function bmap(mode, l, r, desc) vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc }) end -- Navigation - bmap("n", "", next_hunk, "Next Hunk") - bmap("n", "", prev_hunk, "Prev Hunk") + bmap("n", "", prev_hunk, "Prev Hunk") + bmap("n", "", next_hunk, "Next Hunk") bmap("n", "[h", prev_hunk, "Prev Hunk") bmap("n", "]h", next_hunk, "Next Hunk") @@ -909,6 +907,8 @@ local function makespec_gitsigns() -- Hunk bmap("n", "gi", gs.preview_hunk_inline, "Preview Hunk Inline") bmap("n", "gp", gs.preview_hunk, "Preview Hunk") + bmap("n", "gd", gs.diffthis, "Diff This (Index)") + bmap("n", "gD", function() gs.diffthis("~") end, "Diff This (HEAD~1)") bmap("n", "gq", gs.setqflist, "File Hunks to QuickFix") bmap("n", "gQ", function() gs.setqflist("all") end, "All Hunks to QuickFix") bmap("n", "gx", gs.reset_hunk, "Reset Hunk") @@ -926,7 +926,7 @@ local function makespec_gitsigns() bmap("n", "gtb", gs.toggle_current_line_blame, "Toggle Line Blame") bmap("n", "gtd", gs.toggle_deleted, "Toggle Deleted") - -- Text object, e.g. for dih to delete hunk + -- Text Object (e.g., 'dih' to delete hunk) bmap({ "o", "x" }, "ih", ":Gitsigns select_hunk", "Select Hunk") end @@ -934,11 +934,6 @@ local function makespec_gitsigns() "lewis6991/gitsigns.nvim", event = { "BufReadPre", "BufNewFile" }, opts = { - signcolumn = true, - numhl = false, - linehl = false, - word_diff = false, - signs_staged_enable = false, on_attach = on_gitsigns_attach, }, }