1
0
Fork 0
chezmoi/dot_config/nvim/lua/configs/fterm.lua
2022-10-28 09:58:14 +02:00

37 lines
805 B
Lua

local M = {}
function M.setup()
local fterm = require("FTerm")
local lazygit = fterm:new({
-- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = "lazygit",
dimensions = {
height = 0.9,
width = 0.9
}
})
-- Use this to toggle gitui in a floating terminal
vim.keymap.set('n', '<Space>g', function()
lazygit:toggle()
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
return M