From 551d0c4286c8759c744dde2999eb7cbd8428f980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Fri, 28 Oct 2022 09:58:12 +0200 Subject: [PATCH] nvim: git history --- dot_config/nvim/lua/configs/fterm.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dot_config/nvim/lua/configs/fterm.lua b/dot_config/nvim/lua/configs/fterm.lua index bfeffd0..bb999c4 100644 --- a/dot_config/nvim/lua/configs/fterm.lua +++ b/dot_config/nvim/lua/configs/fterm.lua @@ -5,7 +5,7 @@ function M.setup() local fterm = require("FTerm") local lazygit = fterm:new({ - ft = 'fterm_lazygit', -- You can also override the default filetype, if you want + -- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want cmd = "lazygit", dimensions = { height = 0.9, @@ -17,6 +17,21 @@ function M.setup() vim.keymap.set('n', 'g', function() lazygit:toggle() end) + + vim.keymap.set('n', 'H', function() + local file = vim.api.nvim_buf_get_name(0) + local cmd = 'git log -p --ext-diff '..file + local git_history = fterm:new({ + -- ft = 'git_history', -- You can also override the default filetype, if you want + cmd = cmd, + dimensions = { + height = 0.9, + width = 0.9 + } + }) + + git_history:open() + end) end return M