Is it possible to give multiple open_mappings and direction so there is one to one mapping among them.
BSiddharth opened this issue · 2 comments
BSiddharth commented
something like open_mappings = {"<A-v>","<A-f>"}
directions = {"vertical","floating"}
akinsho commented
Nope, unfortunately not. Not currently looking to expand that but I wouldn't say no to a well implemented PR
BSiddharth commented
@akinsho Got it, I did this
require("toggleterm").setup({
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = "<A-v>",
direction = "vertical"
})
vim.keymap.set("n", "<A-f>", ":ToggleTerm direction=float name='Will it work?'<CR>",
{ desc = "Floating term" })
It works however then the mappings kinda get confused and they open the same floating/vertical terminal no matter which key is pressed