diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-22 11:02:52 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-22 11:02:52 +0200 |
| commit | fcc77a343ff2d76cab837e5af60e555753ddf75f (patch) | |
| tree | 6aa6419490125dd3511c3ffdf5649f60cd2ff436 | |
| parent | beb1d119aa45c4837ebf4b57cd6645b56347b8f1 (diff) | |
| download | dotfiles-fcc77a343ff2d76cab837e5af60e555753ddf75f.tar.gz dotfiles-fcc77a343ff2d76cab837e5af60e555753ddf75f.zip | |
misc(nvim): GitBlame shows SHA1 and has better matching logic
| -rw-r--r-- | .config/nvim/plugin/50-git.lua | 7 |
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) |
