From c959b2112fb4c82b5bfd410df21706455225bd40 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 3 Jul 2024 17:03:56 +0100 Subject: minor additions --- lua/user/terminal.lua | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 lua/user/terminal.lua (limited to 'lua/user/terminal.lua') 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 + -- cgit v1.2.3