-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to allow users to open the toggleterm in the current window, just like :term? #528
Comments
well yes it is possible but quite useless... here is a snippet from my plugin... local buf_type = vim.api.nvim_buf_get_option(vim.api.nvim_get_current_buf(), 'buftype')
local terminal_buf_found = false
if buf_type ~= 'terminal' then
local buffers = vim.api.nvim_list_bufs()
for _, buf in ipairs(buffers) do
if vim.api.nvim_buf_get_option(buf, 'buftype') == 'terminal' then
vim.api.nvim_win_set_buf(vim.api.nvim_get_current_win(), buf)
terminal_buf_found = true
break
end
end
if not terminal_buf_found then
vim.api.nvim_exec(':ToggleTerm', false)
end
end the snippet is for a different usecase, in trying to send ctrl+c to the terminal, but maybe thats all you need to write a custom script to achieve what you want |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be quite difficult to manage the window of the
toggleterm
(for example, #97 and #484), so is it possible to allow users opening the toggleterm in the current window(direction="buffer"), just like:term
? So that the manage of thetoggleterm
window will be more flexible. And the users can use some commands such astab
orsetlocal nobuflisted
to change the performance as well.The text was updated successfully, but these errors were encountered: