From 859d1e4a625f53dc299eb879176751fe5f7d75f0 Mon Sep 17 00:00:00 2001 From: Abhinav Robinson Date: Thu, 13 Jun 2024 21:40:24 +0530 Subject: [PATCH] feature: terminal --- lua/custom/plugins/init.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index f245e31c..2c62645e 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: lowercase-global -- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- @@ -9,14 +10,18 @@ return { config = function() require('toggleterm').setup {} local Terminal = require('toggleterm.terminal').Terminal - local lazygit = Terminal:new { cmd = 'lazygit', hidden = true, direction = 'float' } - ---@diagnostic disable-next-line: lowercase-global + local lazygit = Terminal:new { cmd = 'lazygit', hidden = true, direction = 'float' } function _lazygit_toggle() lazygit:toggle() end + vim.api.nvim_set_keymap('n', 'gg', 'lua _lazygit_toggle()', { noremap = true, silent = true }) - vim.api.nvim_set_keymap('n', 'g', 'lua _lazygit_toggle()', { noremap = true, silent = true }) + local terminal = Terminal:new { hidden = true } + function _terminal_toggle() + terminal:toggle() + end + vim.api.nvim_set_keymap('n', 'gt', 'lua _terminal_toggle()', { noremap = true, silent = true }) end, }, }