Skip to content

Commit

Permalink
feat(nvim): use formatter for blame message
Browse files Browse the repository at this point in the history
  • Loading branch information
KirkEasterson committed Sep 12, 2024
1 parent ce3a50f commit b29ae2d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion nvim/.config/nvim/lua/kirk/plugins/git/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,22 @@ return {
untracked = { text = "" },
},
current_line_blame = false,
current_line_blame_formatter = "  <author>  <author_time:%d %b %Y>  <summary>",
current_line_blame_opts = {
delay = 10,
},
current_line_blame_formatter = function(name, blame_info)
if blame_info.author == name then
blame_info.author = "You"
end

local message = string.format(
"%s  %s  %s",
blame_info.author,
os.date("%Y-%b-%d", blame_info.author_time),
blame_info.summary
)

return { { "" .. message, "GitSignsCurrentLineBlame" } }
end,
},
}

0 comments on commit b29ae2d

Please sign in to comment.