Toggle neovim terminal buffers with a single keystroke.
Plug
Plug 'friedow/buggler.nvim'
packer.nvim
use 'friedow/buggler.nvim'
Just add a keybind and start toggling terminals.
vim.keymap.set("n", "<C-1>", function()
require("buggler").toggle_terminal_buffer("Terminal 1")
end)
vim.keymap.set("n", "<C-2>", function()
require("buggler").toggle_terminal_buffer("Terminal 2")
end)Pass a command as the second argument to run it in the terminal. The command is started automatically when the terminal is first opened and restarted whenever it is toggled back and the process has exited.
vim.keymap.set("n", "<C-o>", function()
require("buggler").toggle_terminal_buffer("opencode", "opencode")
end)