2021-11-02 12:19:04 +01:00
|
|
|
local Terminal = require("toggleterm.terminal").Terminal
|
2022-11-18 00:09:51 +01:00
|
|
|
local lazygit = Terminal:new({
|
2022-05-03 19:28:52 +02:00
|
|
|
cmd = "lazygit",
|
|
|
|
dir = "git_dir",
|
|
|
|
direction = "float",
|
|
|
|
float_opts = {
|
|
|
|
winblend = 0,
|
|
|
|
border = "shadow"
|
|
|
|
},
|
|
|
|
on_close = function()
|
|
|
|
Terminal:close()
|
|
|
|
end
|
2022-11-18 00:09:51 +01:00
|
|
|
})
|
2021-11-02 12:19:04 +01:00
|
|
|
|
2022-05-03 19:28:52 +02:00
|
|
|
function _Lazygit_toggle()
|
|
|
|
lazygit:toggle()
|
2021-11-02 12:19:04 +01:00
|
|
|
end
|
|
|
|
|
2022-05-03 19:28:52 +02:00
|
|
|
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua _Lazygit_toggle()<CR>", { noremap = true, silent = true })
|
2021-11-02 12:19:04 +01:00
|
|
|
|
2022-11-18 00:09:51 +01:00
|
|
|
local pnpm = Terminal:new({
|
2022-05-03 19:28:52 +02:00
|
|
|
cmd = "pnpm dev",
|
|
|
|
dir = "git_dir",
|
|
|
|
size = 5,
|
2022-11-18 00:09:51 +01:00
|
|
|
direction = "vertical"
|
|
|
|
})
|
2021-11-02 12:19:04 +01:00
|
|
|
|
2022-05-03 19:28:52 +02:00
|
|
|
function _Pnpm_toggle()
|
|
|
|
pnpm:toggle()
|
2021-11-02 12:19:04 +01:00
|
|
|
end
|
|
|
|
|
2022-05-03 19:28:52 +02:00
|
|
|
vim.api.nvim_set_keymap("n", "<Leader>d", "<cmd>lua _Pnpm_toggle()<CR>", { noremap = true, silent = true })
|
2021-11-02 12:19:04 +01:00
|
|
|
|
2022-11-18 00:09:51 +01:00
|
|
|
local chtConfig = Terminal:new({
|
2022-05-03 19:28:52 +02:00
|
|
|
cmd = "cht",
|
|
|
|
direction = "float"
|
2022-11-18 00:09:51 +01:00
|
|
|
})
|
2022-01-26 20:42:58 +01:00
|
|
|
|
2022-11-18 00:09:51 +01:00
|
|
|
function _ChtConfig_toggle()
|
2022-05-03 19:28:52 +02:00
|
|
|
chtConfig:toggle()
|
2022-01-26 20:42:58 +01:00
|
|
|
end
|
|
|
|
|
2022-11-18 00:09:51 +01:00
|
|
|
vim.api.nvim_set_keymap("n", "<Leader><C-l>", "<cmd>lua _ChtConfig_toggle()<CR>", { noremap = true, silent = true })
|
2022-01-26 20:42:58 +01:00
|
|
|
|
2021-11-02 12:19:04 +01:00
|
|
|
require("toggleterm").setup {
|
2022-05-03 19:28:52 +02:00
|
|
|
shade_terminals = true
|
2021-11-02 12:19:04 +01:00
|
|
|
}
|