feature: terminal

This commit is contained in:
Abhinav Robinson 2024-06-13 21:40:24 +05:30
parent d843dd909d
commit 859d1e4a62
1 changed files with 8 additions and 3 deletions

View File

@ -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', '<leader>gg', '<cmd>lua _lazygit_toggle()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>g', '<cmd>lua _lazygit_toggle()<CR>', { noremap = true, silent = true })
local terminal = Terminal:new { hidden = true }
function _terminal_toggle()
terminal:toggle()
end
vim.api.nvim_set_keymap('n', '<leader>gt', '<cmd>lua _terminal_toggle()<CR>', { noremap = true, silent = true })
end,
},
}