diff --git a/lua/plugins/terminal.lua b/lua/plugins/terminal.lua index a1a6382d..23b9d211 100644 --- a/lua/plugins/terminal.lua +++ b/lua/plugins/terminal.lua @@ -6,6 +6,19 @@ return { require("toggleterm").setup({ direction = "float", }) + local Terminal = require("toggleterm.terminal").Terminal + local lazygit = Terminal:new({ cmd = "sudo lazygit", hidden = true }) + + function _lazygit_toggle() + lazygit:toggle() + end + + vim.api.nvim_set_keymap( + "n", + "g", + "lua _lazygit_toggle()", + { noremap = true, silent = true } + ) end, }, }