TERMINAL GAMING

This commit is contained in:
iris committed 2024-09-09 10:58:25 -04:00
1 parent 69f23e1384
commit bca80aac61
1 file changed
+20 -7
+20 -7
View File
@@ -19,13 +19,27 @@ m.nmap("<leader>tm", m.fcmds({
"belowright 7sp", "belowright 7sp",
"term", "term",
"setlocal nonu", "setlocal nonu",
"setlocal scl=no" "setlocal scl=no",
})) }))
m.nmap("<leader>tn", m.fcmds({ local prev_buf = ""
"term", m.nmap("<leader>tn", function()
"setlocal nonu", if(vim.fn.bufname("terminal") == "") then
"setlocal scl=no" prev_buf = vim.fn.getreg("#")
}).."A") vim.cmd("term")
vim.cmd("setlocal nonu")
vim.cmd("setlocal scl=no")
vim.cmd("keepalt file terminal")
vim.fn.feedkeys("A")
else
if(vim.fn.bufname() == "terminal") then
vim.cmd("b #")
vim.fn.setreg("#", prev_buf)
else
prev_buf = vim.fn.getreg("#")
vim.cmd("b terminal")
end
end
end)
-- move window to new tab -- move window to new tab
m.nmap("<leader>tt", "<C-W><S-T>") m.nmap("<leader>tt", "<C-W><S-T>")
@@ -74,4 +88,3 @@ m.map("x","<leader>p", "\"_dhp")
-- keep centered while moving around -- keep centered while moving around
m.nmap("<C-u>", "<C-u>zz") m.nmap("<C-u>", "<C-u>zz")
m.nmap("<C-d>", "<C-d>zz") m.nmap("<C-d>", "<C-d>zz")