Dotfiles/.config/nvim/lua/plugins/terminal.lua
2024-05-13 23:27:21 +02:00

21 lines
659 B
Lua

return {
"caenrique/buffer-term.nvim",
config = function()
local buffer_term = require("buffer-term")
buffer_term.setup()
-- Keybindings --
vim.keymap.set({ "n", "t" }, "<F6>", buffer_term.toggle_last, { desc = "Toggle Last Terminal" })
local function getToggleTerminalFunction(terminalNumber)
return function()
buffer_term.toggle(terminalNumber)
end
end
for i = 0, 9 do
local key = "<F6>" .. i
vim.keymap.set({ "n", "t" }, key, getToggleTerminalFunction(tostring(i)), { desc = "Toggle Terminal " .. i })
end
end,
}