.dotfiles/configs/nvim/lua/overlays.lua

48 lines
997 B
Lua
Raw Normal View History

2021-11-02 12:19:04 +01:00
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({
2022-05-03 19:28:52 +02:00
cmd = "lazygit",
dir = "git_dir",
direction = "float",
float_opts = {
winblend = 0,
2022-12-13 11:30:23 +01:00
border = "shadow",
2022-05-03 19:28:52 +02:00
},
on_close = function()
Terminal:close()
2022-12-13 11:30:23 +01:00
end,
})
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
local pnpm = Terminal:new({
2022-05-03 19:28:52 +02:00
cmd = "pnpm dev",
dir = "git_dir",
size = 5,
2022-12-13 11:30:23 +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
local chtConfig = Terminal:new({
2022-05-03 19:28:52 +02:00
cmd = "cht",
2022-12-13 11:30:23 +01:00
direction = "float",
})
2022-01-26 20:42:58 +01:00
function _ChtConfig_toggle()
2022-05-03 19:28:52 +02:00
chtConfig:toggle()
2022-01-26 20:42:58 +01:00
end
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
2022-12-13 11:30:23 +01:00
require("toggleterm").setup({
shade_terminals = true,
})