feat(hunks)!: highlight inline overlay diffs

BREAKING CHANGE: rename :GitDiffOverlay to :GitHunkOverlay and <Plug>(git-diff-overlay) to <Plug>(git-hunk-overlay).
This commit is contained in:
2026-05-29 14:59:18 +02:00
parent e6616e260b
commit 351b5690c2
4 changed files with 256 additions and 16 deletions
+8 -7
View File
@@ -241,6 +241,12 @@ end, {
desc = "Open git status view",
})
vim.api.nvim_create_user_command("GitHunkOverlay", function()
require("git.hunks").toggle_overlay()
end, {
desc = "Toggle the git hunk overlay in the current buffer",
})
vim.keymap.set("n", "<Plug>(git-edit)", function()
local rev = vim.fn.input("Edit git object: ")
if rev == "" then
@@ -320,14 +326,9 @@ end, { silent = true, desc = "Preview hunk under cursor" })
vim.keymap.set("n", "<Plug>(git-hunk-select)", function()
require("git.hunks").select_hunk()
end, { silent = true, desc = "Select hunk under cursor" })
vim.keymap.set("n", "<Plug>(git-diff-overlay)", function()
vim.keymap.set("n", "<Plug>(git-hunk-overlay)", function()
require("git.hunks").toggle_overlay()
end, { silent = true, desc = "Toggle the git diff overlay" })
vim.api.nvim_create_user_command("GitDiffOverlay", function()
require("git.hunks").toggle_overlay()
end, { desc = "Toggle the git diff overlay in the current buffer" })
end, { silent = true, desc = "Toggle the git hunk overlay" })
vim.keymap.set("n", "<Plug>(git-blame-popup)", function()
require("git.blame").line_popup()
end, { silent = true, desc = "Show git blame for the current line" })