refactor(git): rework blame highlights and rename overlay to gutter
This commit is contained in:
+10
-6
@@ -4,6 +4,8 @@ end
|
||||
vim.g.loaded_git = 1
|
||||
|
||||
local DEFAULT_HIGHLIGHTS = {
|
||||
GitAuthor = "String",
|
||||
GitDate = "Number",
|
||||
GitIgnored = "Comment",
|
||||
GitSha = "Identifier",
|
||||
GitStaged = "Constant",
|
||||
@@ -41,7 +43,9 @@ local DEFAULT_HIGHLIGHTS = {
|
||||
GitHunkAddLine = "DiffAdd",
|
||||
GitHunkDeleteLine = "DiffDelete",
|
||||
|
||||
GitBlame = "Comment",
|
||||
GitBlameAuthor = "GitAuthor",
|
||||
GitBlameDate = "GitDate",
|
||||
GitBlameInline = "Comment",
|
||||
GitBlameSha = "GitSha",
|
||||
}
|
||||
local STAGED_HUNK_HL = {
|
||||
@@ -318,9 +322,9 @@ vim.api.nvim_create_user_command("GitDiffOverlay", function()
|
||||
require("git.hunks").toggle_overlay()
|
||||
end, { desc = "Toggle the git diff overlay in the current buffer" })
|
||||
|
||||
vim.keymap.set("n", "<Plug>(git-blame)", function()
|
||||
require("git.blame").toggle_overlay()
|
||||
end, { silent = true, desc = "Toggle the full-file git blame overlay" })
|
||||
vim.keymap.set("n", "<Plug>(git-blame-gutter)", function()
|
||||
require("git.blame").toggle_gutter()
|
||||
end, { silent = true, desc = "Toggle the full-file git blame gutter" })
|
||||
vim.keymap.set("n", "<Plug>(git-blame-line)", function()
|
||||
require("git.blame").toggle_inline()
|
||||
end, { silent = true, desc = "Toggle inline git blame" })
|
||||
@@ -341,8 +345,8 @@ end, {
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command("GitBlame", function()
|
||||
require("git.blame").toggle_overlay()
|
||||
end, { desc = "Toggle the full-file git blame overlay in the current buffer" })
|
||||
require("git.blame").toggle_gutter()
|
||||
end, { desc = "Toggle the full-file git blame gutter in the current buffer" })
|
||||
vim.api.nvim_create_user_command("GitBlameLine", function()
|
||||
require("git.blame").toggle_inline()
|
||||
end, { desc = "Toggle inline git blame in the current buffer" })
|
||||
|
||||
Reference in New Issue
Block a user