summary refs log tree commit diff
path: root/.config/nvim/after/ftplugin/gitrebase.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/nvim/after/ftplugin/gitrebase.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/.config/nvim/after/ftplugin/gitrebase.lua b/.config/nvim/after/ftplugin/gitrebase.lua
index f85d3b9..fb64534 100644
--- a/.config/nvim/after/ftplugin/gitrebase.lua
+++ b/.config/nvim/after/ftplugin/gitrebase.lua
@@ -1,4 +1,19 @@
 vim.keymap.set('n', 'K', function()
-  -- local cword = vim.fn.expand('<cword>')
-  -- require('gitsigns').show_commit(cword, 'aboveleft split')
+  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 })