1
0
Fork 0
chezmoi/dot_config/nvim/lua/configs/packages/fterm.lua
2023-01-02 21:35:41 +01:00

37 lines
842 B
Lua

local lazygit = function()
local fterm = require('FTerm')
fterm.scratch({
-- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = 'lazygit',
auto_close = true,
dimensions = {
height = 0.9,
width = 0.9
}
})
end
local git_history = function()
local fterm = require('FTerm')
local file = vim.api.nvim_buf_get_name(0)
local cmd = 'git log -p --ext-diff ' .. file
fterm.scratch({
-- ft = 'git_history', -- You can also override the default filetype, if you want
cmd = cmd,
auto_close = true,
dimensions = {
height = 0.9,
width = 0.9
}
})
end
return {
'numToStr/FTerm.nvim',
keys = {
{ '<Space>g', lazygit, { desc = 'Toggle lazygit' } },
{ '<Space>H', git_history, { desc = 'Show git history' } }
},
lazy = true,
}