1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
vim.keymap.set('n', 'K', function()
local commit = vim.fn.expand('<cword>')
local content = nil
require('mod.jobs').start({
cmd = { 'git', 'show', '--patch', '--stat', commit },
stdout_buffered = true,
on_stdout = function(_, stdout)
content = stdout
end,
on_exit = function()
require('mod.win').popup(
'git-show: ' .. commit,
content,
{ buf = { filetype = 'gitcommit' } }
)
end,
})
end, { desc = 'Lookup commit hash', buffer = 0 })
|