summaryrefslogtreecommitdiffstats
path: root/.config/nvim/plugin
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-22 11:02:52 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-22 11:02:52 +0200
commitfcc77a343ff2d76cab837e5af60e555753ddf75f (patch)
tree6aa6419490125dd3511c3ffdf5649f60cd2ff436 /.config/nvim/plugin
parentbeb1d119aa45c4837ebf4b57cd6645b56347b8f1 (diff)
downloaddotfiles-fcc77a343ff2d76cab837e5af60e555753ddf75f.tar.gz
dotfiles-fcc77a343ff2d76cab837e5af60e555753ddf75f.zip
misc(nvim): GitBlame shows SHA1 and has better matching logic
Diffstat (limited to '.config/nvim/plugin')
-rw-r--r--.config/nvim/plugin/50-git.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/.config/nvim/plugin/50-git.lua b/.config/nvim/plugin/50-git.lua
index 8a8a634..609ab93 100644
--- a/.config/nvim/plugin/50-git.lua
+++ b/.config/nvim/plugin/50-git.lua
@@ -15,7 +15,12 @@ local function git_blame(file, line)
local sys = vim.system({
"bash",
"-c",
- string.format('grep -E "^author |^summary " <(git blame -L %d,%d --porcelain -- %s)', line, line, file),
+ string.format(
+ 'grep -E --only-matching "^author .*$|^summary .*$|^[[:xdigit:]]{40}" <(git blame -L %d,%d --porcelain -- %s)',
+ line,
+ line,
+ file
+ ),
}):wait()
if sys.stdout then
vim.notify(sys.stdout, vim.log.levels.INFO)