added lazygit plugin

This commit is contained in:
Oliver Hartmann 2023-01-28 21:39:46 +01:00
parent a7a4319243
commit 6c51bce00d
2 changed files with 26 additions and 23 deletions

26
lua/plugins/lazygit.lua Normal file
View File

@ -0,0 +1,26 @@
return {
'kdheepak/lazygit.nvim',
dependencies = {
'nvim-telescope/telescope.nvim'
},
cmd = {
'LazyGit',
'LazyGitConfig',
'LazyGitFilter',
'LazyGitFilterCurrentFile',
'LazyGit',
},
config = function ()
require("telescope").load_extension("lazygit")
end,
keys = {
{
'<Space>g',
function ()
require('lazygit').lazygit()
end
}
}
}

View File

@ -19,29 +19,6 @@ return {
local Terminal = require('toggleterm.terminal').Terminal local Terminal = require('toggleterm.terminal').Terminal
local lazygit = Terminal:new({
cmd = 'lazygit',
-- dir = vim.fn.getcwd(),
hidden = true,
direction = 'float',
on_open = function(term)
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
-- vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<esc>', '<esc>', {noremap = true, silent = true})
end,
})
function _lazygit_toggle()
lazygit:toggle()
end
end, end,
cmd = 'ToggleTerm', cmd = 'ToggleTerm',
keys = {
{
'<Space>g',
function()
_lazygit_toggle()
end,
desc= 'Open lazygit',
}
}
} }