From 31c8088db2b8555046252d152cc52cb36cead6e6 Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Wed, 5 Nov 2025 19:30:35 +0100 Subject: [PATCH] in gitsigns: no word diff by default and add a bind to toggle --- lua/plugins.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 82f3ad2..b36f2ae 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -253,7 +253,7 @@ local plugins = { "lewis6991/gitsigns.nvim", config = function() require('gitsigns').setup({ - word_diff = true, + numhl = true, on_attach = function(bufnr) local gs = package.loaded.gitsigns @@ -310,7 +310,12 @@ local plugins = { ) map('n', 'hd', gs.diffthis, { desc = "Diff this" }) map('n', 'hD', function() gs.diffthis('~') end, { desc = "Diff this (ignore whitespace)" }) - map('n', 'td', gs.toggle_deleted, { desc = "Toggle deleted" }) + map( + "n", + "td", + function () gs.toggle_linehl() gs.toggle_word_diff() gs.toggle_deleted() end, + { desc = "toggle diff highlight" } + ) -- Text object map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = "Select hunk" })