terminal & stuff

This commit is contained in:
iris committed 2024-12-15 12:05:09 -05:00
1 parent bca80aac61
commit 24108cae78
2 files changed
+9 -6

No files matched your search

+5 -2
View File
@@ -22,7 +22,7 @@ m.nmap("<leader>tm", m.fcmds({
"setlocal scl=no",
}))
local prev_buf = ""
m.nmap("<leader>tn", function()
m.nmap("<leader>i", function()
if(vim.fn.bufname("terminal") == "") then
prev_buf = vim.fn.getreg("#")
vim.cmd("term")
@@ -33,10 +33,13 @@ m.nmap("<leader>tn", function()
else
if(vim.fn.bufname() == "terminal") then
vim.cmd("b #")
vim.fn.setreg("#", prev_buf)
if (string.len(prev_buf) ~= 0) then
vim.fn.setreg("#", prev_buf)
end
else
prev_buf = vim.fn.getreg("#")
vim.cmd("b terminal")
vim.fn.feedkeys("A")
end
end
end)