Closed abd0-omar closed 10 months ago
You can use vim.w to store a variable to determine whether or not it is running.
@AbdoOrigin Currently with better_term mode you can assign a key to toggle the terminal
Thanks, I'll look into it
I know this is closed, but, I achieved the desired functionality by just using lua.
Here's a snippet on how to go about it for anyone who might want to implement this.
vim.keymap.set("n", "<leader>ex", function()
local bufname = vim.fn.bufname("%")
if bufname:find("crunner_") then
vim.cmd("RunClose")
else
vim.cmd("RunCode")
end
end, { desc = "Toggle Code Runner" })
I know this is closed, but, I achieved the desired functionality by just using lua.
Here's a snippet on how to go about it for anyone who might want to implement this.
vim.keymap.set("n", "<leader>ex", function() local bufname = vim.fn.bufname("%") if bufname:find("crunner_") then vim.cmd("RunClose") else vim.cmd("RunCode") end end, { desc = "Toggle Code Runner" })
Yeah that's exactly what I wanted a while back
I user to run the code, is it possible to RunClose with r too?