nvim: git history
This commit is contained in:
parent
eddecc8568
commit
551d0c4286
1 changed files with 16 additions and 1 deletions
|
@ -5,7 +5,7 @@ function M.setup()
|
||||||
local fterm = require("FTerm")
|
local fterm = require("FTerm")
|
||||||
|
|
||||||
local lazygit = fterm:new({
|
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",
|
cmd = "lazygit",
|
||||||
dimensions = {
|
dimensions = {
|
||||||
height = 0.9,
|
height = 0.9,
|
||||||
|
@ -17,6 +17,21 @@ function M.setup()
|
||||||
vim.keymap.set('n', '<Space>g', function()
|
vim.keymap.set('n', '<Space>g', function()
|
||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<Space>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
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Reference in a new issue