summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-20 15:00:46 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-20 15:00:46 +0200
commitb49254b4e382457fe242a32498a5bcd1b4f9c9c1 (patch)
tree777aa04679b240feac3f109da58db05a9fffa751
parentc37b1cd4bdbea33f746e4f14e0b9d68cdedaadc2 (diff)
downloaddotfiles-b49254b4e382457fe242a32498a5bcd1b4f9c9c1.tar.gz
dotfiles-b49254b4e382457fe242a32498a5bcd1b4f9c9c1.zip
feat(nvim): add GitBlame user command
-rw-r--r--.config/nvim/plugin/50-git.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/.config/nvim/plugin/50-git.lua b/.config/nvim/plugin/50-git.lua
new file mode 100644
index 0000000..66adda8
--- /dev/null
+++ b/.config/nvim/plugin/50-git.lua
@@ -0,0 +1,7 @@
+local function git_blame(file, line)
+ vim.cmd(string.format("!git blame --line-porcelain -L %d,%d -- %s", line, line, file))
+end
+
+vim.api.nvim_create_user_command("GitBlame", function()
+ git_blame(vim.api.nvim_buf_get_name(0), vim.api.nvim_win_get_cursor(0)[1])
+end, { desc = "Show current line git blame" })