Open medwatt opened 2 years ago
When a hidden floaterm is shown, window config is read from buffer local variables, using floaterm#config#get_all()
.
If you keep track of the buffer number, you should be able to modify the options with setbufvar()
before showing the floaterm.
In this case, you need e.g. setbufvar(<bufnr>, 'floaterm_wintype', 'split')
(or vsplit
for vertical).
I tested it by opening a floaterm, using :echo bufnr()
to check the number, then :FloatermHide
. Modify the wintype using command as above, then :FloatermShow
.
I haven't used the lua API but I imagine the command names are similar.
My default settings is currently to open terminals on the right. However, there are some cases when vim is occupying have of my screen real-estate and, in those cases, I would like the same terminal to now open on the bottom when I toggle it.
I can write a function that does exactly that, but I would it to work when toggling, not when opening a new terminal. Can this be done?