added lazygit plugin
This commit is contained in:
parent
a7a4319243
commit
6c51bce00d
26
lua/plugins/lazygit.lua
Normal file
26
lua/plugins/lazygit.lua
Normal 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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user