aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2022-09-24 15:34:54 +0800
committerjdhao <jdhao@hotmail.com>2022-09-24 15:34:54 +0800
commit1f3fcc604a831915605d9c5a01a3245109d603da (patch)
tree350ab541a15352af5020cd0b10152923a63097e6 /lua
parent7f5bf5a1b20be5351142fb8e73e51acf03cd85ac (diff)
enable word diff for gitsigns.nvim
Also tweak the highlight for word diff to make clear. The default highlgiht for word diff is TermCursor, which is unreadable.
Diffstat (limited to 'lua')
-rw-r--r--lua/config/gitsigns.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/config/gitsigns.lua b/lua/config/gitsigns.lua
index 3c48d53..175ce35 100644
--- a/lua/config/gitsigns.lua
+++ b/lua/config/gitsigns.lua
@@ -8,6 +8,7 @@ gs.setup {
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
changedelete = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
},
+ word_diff = true,
on_attach = function(bufnr)
local function map(mode, l, r, opts)
opts = opts or {}
@@ -43,3 +44,12 @@ gs.setup {
end)
end,
}
+
+vim.api.nvim_create_autocmd('ColorScheme', {
+ pattern = "*",
+ callback = function()
+ vim.cmd [[
+ hi GitSignsChangeInline guibg=fg guifg=bg
+ ]]
+ end
+})