summaryrefslogtreecommitdiff
path: root/lua/user/terminal.lua
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-07-03 17:03:56 +0100
committerYour Name <you@example.com>2024-07-03 17:03:56 +0100
commitc959b2112fb4c82b5bfd410df21706455225bd40 (patch)
tree6774868448d127c2f560827de8e5edbd868a2832 /lua/user/terminal.lua
minor additionsHEADmaster
Diffstat (limited to 'lua/user/terminal.lua')
-rw-r--r--lua/user/terminal.lua75
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
+