I would like to have a terminal buffer that is hidden when it starts, and then, through a command (preferably mapped to a key binding), it can be shown or hidden as a floating window inside Neovim.
In theory, toggleterm.nvim can do this. However, I’m having trouble understanding how to make a terminal buffer hidden by default. According to its README (and also :h toggleterm
):
term:spawn()
can be used to start the command in a background buffer without opening a terminal window yet
What does term:spawn()
mean and how is it used? Does this refer to an internal method of the plugin, or something built into Neovim?