fix diffs

This commit is contained in:
Harivansh Rathi 2026-02-03 16:24:23 -05:00
parent c86c905c58
commit cbd29817fb
8 changed files with 54 additions and 33 deletions

10
lua/plugins/diffs.lua Normal file
View file

@ -0,0 +1,10 @@
return {
"barrettruth/diffs.nvim",
ft = { "git", "fugitive", "diff" },
opts = {
hide_prefix = true,
highlights = {
gutter = true,
},
},
}

View file

@ -66,4 +66,13 @@ return {
},
},
-- Fugitive: Additional Git commands
{
'tpope/vim-fugitive',
cmd = { 'Git', 'Gblame', 'Gdiff', 'Gread', 'Gwrite', 'Ggrep' },
keys = {
{ '<leader>gb', '<cmd>Git blame<cr>', desc = 'Git Blame' },
{ '<leader>gd', '<cmd>Gdiff<cr>', desc = 'Git Diff (Fugitive)' },
}
},
}

View file

@ -3,39 +3,34 @@ return {
event = { "BufReadPre", "BufNewFile" },
config = function()
require("gitsigns").setup({
-- Disable sign column indicators
signcolumn = false,
-- Show colors on line numbers
numhl = true,
-- Highlight the entire line for changed lines (Cursor-style)
signcolumn = true,
numhl = false,
linehl = true,
-- Highlight the word that changed within a line
word_diff = true,
-- Show git blame at end of current line (optional, can be distracting)
current_line_blame = false,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol',
delay = 1000,
ignore_whitespace = false,
word_diff = false,
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
-- Preview window configuration
preview_config = {
border = 'rounded',
style = 'minimal',
signs_staged = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
signs_staged_enable = true,
on_attach = function(bufnr)
-- Set up Cursor-style line highlights (subtle background colors)
-- Green tint for added lines
-- Unstaged changes - line highlighting
vim.api.nvim_set_hl(0, "GitSignsAddLn", { bg = "#2a3a2a" })
-- Red tint for removed/changed lines
vim.api.nvim_set_hl(0, "GitSignsChangeLn", { bg = "#3a2a2a" })
vim.api.nvim_set_hl(0, "GitSignsChangeLn", { bg = "#3a3a2a" })
vim.api.nvim_set_hl(0, "GitSignsDeleteLn", { bg = "#3a2a2a" })
vim.api.nvim_set_hl(0, "GitSignsChangedeleteLn", { bg = "#3a2a2a" })
-- Word diff highlights (more prominent)
vim.api.nvim_set_hl(0, "GitSignsAddLnInline", { bg = "#3d5a3d" })
vim.api.nvim_set_hl(0, "GitSignsChangeLnInline", { bg = "#5a3d3d" })
vim.api.nvim_set_hl(0, "GitSignsDeleteLnInline", { bg = "#5a3d3d" })
-- Staged changes - NO line highlighting (gutter only)
vim.api.nvim_set_hl(0, "GitSignsStagedAddLn", {})
vim.api.nvim_set_hl(0, "GitSignsStagedChangeLn", {})
vim.api.nvim_set_hl(0, "GitSignsStagedDeleteLn", {})
end,
})
end,

View file

@ -7,11 +7,11 @@ return {
ensure_installed = { "lua", "vim", "vimdoc", "query", "javascript", "typescript", "python", "html", "css", "json", "yaml", "markdown" },
auto_install = true,
highlight = {
enable = true,
enable = false,
},
indent = {
enable = true,
},
})
end,
}
}