diff options
Diffstat (limited to 'lua/user/terminal.lua')
| -rw-r--r-- | lua/user/terminal.lua | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/lua/user/terminal.lua b/lua/user/terminal.lua new file mode 100644 index 0000000..8aac7cd --- /dev/null +++ b/lua/user/terminal.lua @@ -0,0 +1,75 @@ +local M={} +M.ipython_toggle = function() + local Terminal = require("toggleterm.terminal").Terminal + local ipython = Terminal:new { + cmd = "ipython", + hidden = true, + direction = "horizontal", + on_open = function(_) + vim.cmd "startinsert!" + end, + on_close = function(_) end, + count = 98, + display_name = "ipython", + label = "ipython", + } + ipython:toggle() +end + +M.scim_toggle = function() + local Terminal = require("toggleterm.terminal").Terminal + local scim = Terminal:new { + cmd = "sc-im", + hidden = true, + direction = "horizontal", + on_open = function(_) + vim.cmd "startinsert!" + end, + on_close = function(_) end, + count = 97, + display_name = "sc-im", + label = "sc-im", + } + scim:toggle() +end + +M.w3m_toggle = function() + local Terminal = require("toggleterm.terminal").Terminal + local w3m = Terminal:new { + cmd = "w3m -B", + hidden = true, + direction = "horizontal", + on_open = function(_) + vim.cmd "startinsert!" + end, + on_close = function(_) end, + count = 96, + display_name = "w3m", + label = "w3m", + } + w3m:toggle() +end + +M.lazygit_toggle = function() + local Terminal = require("toggleterm.terminal").Terminal + local lazygit = Terminal:new { + cmd = "lazygit", + hidden = true, + direction = "float", + float_opts = { + border = "none", + width = 100000, + height = 100000, + zindex = 200, + }, + on_open = function(_) + vim.cmd "startinsert!" + end, + on_close = function(_) end, + count = 99, + } + lazygit:toggle() +end + +return M + |
